@font-face {
    font-family: "Bravura";
    src: url("../fonts/Bravura.woff2") format("woff2");
    font-display: block;
}

:root {
    --bg: #07080a;
    --bg-soft: #101114;
    --surface: #15171b;
    --surface-strong: #1d2026;
    --text: #f7f8fa;
    --muted: #b7bcc6;
    --line: rgba(247, 248, 250, 0.14);
    --gold: #f4b321;
    --gold-strong: #ffca3d;
    --on-gold: #11100e;
    --green: #40d1b1;
    --teal: #39a6b7;
    --blue: #71b8ff;
    --rose: #ff7a9a;
    --shadow: 0 14px 42px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-width: 320px;
    max-width: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 70% -10%, rgba(64, 209, 177, 0.08), transparent 30rem),
        linear-gradient(180deg, var(--bg), var(--bg-soft));
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

main,
.site-header,
.messages,
.back-button,
.mobile-tabbar {
    position: relative;
}

main {
    z-index: 1;
}

.music-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.public-page .music-ambient {
    z-index: 0;
}

.public-page main {
    position: relative;
    z-index: 1;
}

.piano-keys-ambient {
    position: absolute;
    right: -4.5rem;
    top: 8.4rem;
    width: 18.2rem;
    height: 5.3rem;
    border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    opacity: 0.38;
    overflow: hidden;
    pointer-events: auto;
    touch-action: none;
    transform: rotate(-9deg);
    --piano-step: 7.142857%;
    --piano-key-speed: 4.5s;
    background:
        linear-gradient(180deg, rgba(158, 18, 31, 0.98) 0 0.22rem, rgba(106, 7, 17, 0.94) 0.22rem 0.34rem, transparent 0.34rem),
        repeating-linear-gradient(90deg, transparent 0 calc(var(--piano-step) - 0.06rem), rgba(25, 27, 31, 0.4) calc(var(--piano-step) - 0.06rem) var(--piano-step)),
        linear-gradient(180deg, #ffffff 0%, #f6f8fb 68%, #dce3ec 100%);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    animation: piano-drift 14s ease-in-out infinite alternate;
}

.piano-keys-ambient-left {
    left: -5.4rem;
    right: auto;
    top: auto;
    bottom: 13vh;
    opacity: 0.3;
    transform: rotate(8deg);
    animation: piano-drift-left 16s ease-in-out infinite alternate;
}

.piano-keys-ambient.is-user-controlled {
    opacity: 0.52;
}

.piano-keys-ambient-left.is-user-controlled {
    opacity: 0.44;
}

.piano-keys-ambient::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.05rem;
    width: 0.62rem;
    height: 3.05rem;
    border-radius: 0 0 4px 4px;
    background: rgba(0, 0, 0, 0.82);
    box-shadow:
        1.32rem 0 0 rgba(0, 0, 0, 0.82),
        3.96rem 0 0 rgba(0, 0, 0, 0.82),
        5.28rem 0 0 rgba(0, 0, 0, 0.82),
        6.6rem 0 0 rgba(0, 0, 0, 0.82),
        9.24rem 0 0 rgba(0, 0, 0, 0.82),
        10.56rem 0 0 rgba(0, 0, 0, 0.82),
        13.2rem 0 0 rgba(0, 0, 0, 0.82),
        14.52rem 0 0 rgba(0, 0, 0, 0.82),
        15.84rem 0 0 rgba(0, 0, 0, 0.82);
    z-index: 4;
}

.ambient-note {
    position: absolute;
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.1rem;
    opacity: 0;
    pointer-events: auto;
    touch-action: manipulation;
    animation: ambient-note-float 6.9s ease-in-out infinite;
}

.ambient-note::before {
    content: "\266A";
    display: block;
    transform-origin: center;
}

.ambient-note:hover::before,
.ambient-note:active::before,
.ambient-note.is-popping::before {
    animation: ambient-note-pop 360ms ease-out both;
}

.ambient-note.is-popping {
    opacity: 0.95 !important;
    animation-play-state: paused;
}

.ambient-note.is-popped {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
}

.ambient-note-b::before {
    content: "\266B";
}

.ambient-note-a {
    left: 7vw;
    top: 26vh;
}

.ambient-note-b {
    right: 14vw;
    top: 54vh;
    animation-delay: 1.8s;
}

.ambient-note-c {
    left: 19vw;
    bottom: 13vh;
    animation-delay: 3.2s;
}

.ambient-note-d {
    right: 8vw;
    top: 22vh;
    font-size: 1.45rem;
    animation-delay: 4.4s;
}

.ambient-note-e {
    left: 42vw;
    bottom: 9vh;
    font-size: 1.55rem;
    animation-delay: 5.7s;
}

.ambient-note-d::before {
    content: "\266C";
}

.ambient-note-depth {
    font-size: 3rem;
    opacity: 0;
    filter: blur(0.2px);
    animation: ambient-note-depth-float 5.9s ease-in-out infinite;
}

.ambient-note-f {
    left: 12vw;
    top: 62vh;
    animation-delay: 0.7s;
}

.ambient-note-g {
    right: 30vw;
    top: 18vh;
    animation-delay: 2.1s;
}

.ambient-note-h {
    right: 5vw;
    bottom: 17vh;
    animation-delay: 3.8s;
}

.ambient-note-g::before {
    content: "\266B";
}

.ambient-note-i {
    left: 55vw;
    top: 36vh;
    font-size: 1.42rem;
    animation-delay: 0.9s;
}

.ambient-note-j {
    left: 4vw;
    bottom: 34vh;
    font-size: 1.7rem;
    animation-delay: 4.9s;
}

.ambient-note-k {
    right: 18vw;
    bottom: 8vh;
    font-size: 2.35rem;
    animation-delay: 1.25s;
}

.ambient-note-l {
    left: 22vw;
    bottom: 10vh;
    font-size: 1.35rem;
    animation-delay: 2.8s;
}

.ambient-note-m {
    right: 38vw;
    top: 12vh;
    font-size: 2.6rem;
    animation-delay: 3.4s;
}

.ambient-note-n {
    left: 76vw;
    top: 58vh;
    font-size: 2rem;
    animation-delay: 5.2s;
}

.ambient-note-o {
    left: 64vw;
    bottom: 24vh;
    font-size: 1.55rem;
    animation-delay: 1.45s;
}

.ambient-note-p {
    left: 8vw;
    top: 44vh;
    font-size: 2.45rem;
    animation-delay: 2.45s;
}

.ambient-note-q {
    right: 24vw;
    top: 72vh;
    font-size: 1.7rem;
    animation-delay: 4.15s;
}

.ambient-note-r {
    right: 10vw;
    top: 38vh;
    font-size: 2.25rem;
    animation-delay: 0.35s;
}

.ambient-note-j::before,
.ambient-note-k::before,
.ambient-note-m::before,
.ambient-note-p::before {
    content: "\266C";
}

.ambient-note-l::before,
.ambient-note-n::before,
.ambient-note-q::before {
    content: "\266B";
}

.piano-play-line {
    display: none;
}

.piano-key-pulse {
    position: absolute;
    top: 0.34rem;
    bottom: 0.12rem;
    z-index: 2;
    left: calc(var(--piano-key-left) + 0.03rem);
    width: calc(var(--piano-step) - 0.08rem);
    border-radius: 0 0 5px 5px;
    opacity: 0;
    pointer-events: none;
    transform-origin: top center;
    animation: piano-key-pulse var(--piano-key-speed) linear infinite;
    animation-delay: var(--piano-key-delay);
    transition: opacity 420ms ease;
    box-shadow: inset 0 0.45rem 0 rgba(255, 255, 255, 0.18);
}

.piano-keys-ambient.is-user-controlled .piano-key-pulse {
    animation: none;
    opacity: 0;
}

.piano-keys-ambient.is-user-controlled .piano-key-pulse.is-manual-active {
    opacity: 1;
    transition-duration: 0ms;
}

.piano-key-pulse-1 { --piano-key-left: 0%; --piano-key-delay: 0s; background: linear-gradient(180deg, rgba(244, 179, 33, 0.58), rgba(244, 179, 33, 0.18)); }
.piano-key-pulse-2 { --piano-key-left: 7.142857%; --piano-key-delay: 0.3s; background: linear-gradient(180deg, rgba(64, 209, 177, 0.54), rgba(64, 209, 177, 0.16)); }
.piano-key-pulse-3 { --piano-key-left: 14.285714%; --piano-key-delay: 0.6s; background: linear-gradient(180deg, rgba(113, 184, 255, 0.5), rgba(113, 184, 255, 0.15)); }
.piano-key-pulse-4 { --piano-key-left: 21.428571%; --piano-key-delay: 0.9s; background: linear-gradient(180deg, rgba(255, 122, 154, 0.48), rgba(255, 122, 154, 0.14)); }
.piano-key-pulse-5 { --piano-key-left: 28.571428%; --piano-key-delay: 1.2s; background: linear-gradient(180deg, rgba(255, 202, 61, 0.56), rgba(255, 202, 61, 0.17)); }
.piano-key-pulse-6 { --piano-key-left: 35.714285%; --piano-key-delay: 1.5s; background: linear-gradient(180deg, rgba(57, 166, 183, 0.5), rgba(57, 166, 183, 0.14)); }
.piano-key-pulse-7 { --piano-key-left: 42.857142%; --piano-key-delay: 1.8s; background: linear-gradient(180deg, rgba(64, 209, 177, 0.52), rgba(64, 209, 177, 0.15)); }
.piano-key-pulse-8 { --piano-key-left: 50%; --piano-key-delay: 2.1s; background: linear-gradient(180deg, rgba(244, 179, 33, 0.56), rgba(244, 179, 33, 0.17)); }
.piano-key-pulse-9 { --piano-key-left: 57.142857%; --piano-key-delay: 2.4s; background: linear-gradient(180deg, rgba(113, 184, 255, 0.5), rgba(113, 184, 255, 0.15)); }
.piano-key-pulse-10 { --piano-key-left: 64.285714%; --piano-key-delay: 2.7s; background: linear-gradient(180deg, rgba(255, 122, 154, 0.46), rgba(255, 122, 154, 0.13)); }
.piano-key-pulse-11 { --piano-key-left: 71.428571%; --piano-key-delay: 3s; background: linear-gradient(180deg, rgba(255, 202, 61, 0.54), rgba(255, 202, 61, 0.16)); }
.piano-key-pulse-12 { --piano-key-left: 78.571428%; --piano-key-delay: 3.3s; background: linear-gradient(180deg, rgba(57, 166, 183, 0.48), rgba(57, 166, 183, 0.14)); }
.piano-key-pulse-13 { --piano-key-left: 85.714285%; --piano-key-delay: 3.6s; background: linear-gradient(180deg, rgba(64, 209, 177, 0.5), rgba(64, 209, 177, 0.15)); }
.piano-key-pulse-14 { --piano-key-left: 92.857142%; --piano-key-delay: 3.9s; background: linear-gradient(180deg, rgba(244, 179, 33, 0.54), rgba(244, 179, 33, 0.16)); animation-name: piano-key-pulse-last; }

.piano-keys-ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    background:
        linear-gradient(90deg,
            transparent 0 6%,
            rgba(255, 255, 255, 0.14) 7% 8%,
            transparent 10% 21%,
            rgba(255, 255, 255, 0.1) 22% 23%,
            transparent 25% 42%,
            rgba(255, 255, 255, 0.12) 43% 44%,
            transparent 46% 100%),
        linear-gradient(180deg, transparent 0 0.34rem, rgba(255, 255, 255, 0.08) 0.34rem, transparent 58%, rgba(0, 0, 0, 0.12));
    opacity: 0.54;
}

.keyboard-preview-page .site-header,
.keyboard-preview-page .ambient-note {
    display: none;
}

.keyboard-preview-page .keyboard-preview-canvas {
    min-height: 100vh;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}

.brand-symbol {
    color: var(--gold);
    font-size: 1.9rem;
    line-height: 1;
}

.brand-logo-wrap {
    display: inline-grid;
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 2.15rem;
    place-items: center;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.36));
}

.brand-text,
.brand small {
    display: block;
}

.brand-text {
    min-width: 0;
}

.brand-wordmark {
    display: block;
    width: 6.15rem;
    max-width: 30vw;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.32));
}

.brand small {
    color: var(--muted);
    font-family: Georgia, 'Times New Roman', serif;
}

.main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
}

.account-nav {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    gap: 0.65rem;
    align-items: center;
    justify-self: end;
    min-width: 0;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.public-main-nav {
    overflow: visible;
}

.public-mobile-menu {
    display: none;
}

.hamburger-icon {
    position: relative;
    display: inline-block;
    width: 1.1rem;
    height: 0.82rem;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.hamburger-icon::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transform: translateY(-50%);
}

.admin-nav-menu {
    position: relative;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
}

.admin-nav-trigger {
    display: inline-flex;
    min-height: 2.4rem;
    align-items: center;
    gap: 0.48rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.34rem 0.72rem;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    color: var(--gold);
    cursor: pointer;
    font-weight: 850;
    list-style: none;
}

.admin-nav-trigger::-webkit-details-marker {
    display: none;
}

.admin-nav-trigger:hover,
.admin-nav-menu[open] .admin-nav-trigger {
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
    color: var(--text);
}

.admin-nav-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(2, minmax(10rem, 1fr));
    gap: 0.35rem;
    width: min(28rem, calc(100vw - 2rem));
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-strong) 96%, #000);
    box-shadow: var(--shadow);
}

.admin-nav-panel a {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 0.45rem 0.6rem;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.admin-nav-panel a:hover,
.admin-nav-panel a.is-active {
    border-color: color-mix(in srgb, var(--gold) 34%, var(--line));
    background: color-mix(in srgb, var(--gold) 10%, transparent);
    color: var(--text);
}

.main-nav a,
.main-nav .nav-menu-item,
.account-nav a,
.link-button {
    color: var(--muted);
    font: inherit;
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav > * + * {
    margin-left: 0.6rem;
    padding-left: 0.6rem;
    border-left: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.platform-admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.platform-admin-nav > div:first-child {
    display: grid;
    gap: .15rem;
}

.platform-admin-nav small {
    color: var(--muted);
}

@media (max-width: 640px) {
    .platform-admin-nav {
        align-items: stretch;
        flex-direction: column;
    }
}

.account-nav > * + * {
    margin-left: 0.65rem;
    padding-left: 0.65rem;
    border-left: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.account-nav > .notification-menu {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

.main-nav a:hover,
.main-nav .nav-menu-item:hover > .nav-menu-trigger,
.main-nav .nav-menu-item:focus-within > .nav-menu-trigger,
.account-nav a:hover,
.link-button:hover {
    color: var(--gold);
}

.nav-menu-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-block: 0.45rem;
}

.nav-menu-item::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.75rem;
}

.nav-submenu {
    position: absolute;
    left: 0;
    top: calc(100% + 0.2rem);
    z-index: 20;
    display: grid;
    min-width: 10.5rem;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 96%, #000000);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.25rem) scale(0.98);
    transform-origin: top left;
    transition: opacity 160ms ease, transform 160ms ease;
}

.nav-submenu a {
    padding: 0.55rem 0.65rem;
    border-radius: 7px;
}

.nav-submenu a:hover {
    background: color-mix(in srgb, var(--gold) 14%, transparent);
}

.nav-menu-item:hover .nav-submenu,
.nav-menu-item:focus-within .nav-submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.nav-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.theme-toggle {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--gold);
    cursor: pointer;
}

.messages {
    position: fixed;
    top: 5.2rem;
    right: 1rem;
    z-index: 30;
    display: grid;
    gap: 0.5rem;
    width: min(24rem, calc(100vw - 2rem));
}

.message {
    position: relative;
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin: 0;
    overflow: hidden;
    padding: 0.85rem 1rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    animation: toast-in 220ms ease-out both;
}

.message::before {
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 1.35rem;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 18%, transparent);
    color: var(--text);
    font-weight: 900;
    line-height: 1;
    content: "i";
}

.message::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: color-mix(in srgb, var(--muted) 64%, transparent);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    animation: toast-progress 5600ms linear forwards;
}

.message.is-leaving {
    animation: toast-out 180ms ease-in forwards;
}

.message-content {
    min-width: 0;
}

.message-action {
    align-self: center;
    margin-left: auto;
    border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line));
    border-radius: 999px;
    padding: 0.34rem 0.68rem;
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.message-action:hover {
    background: var(--gold);
    color: var(--on-gold);
}

.message-success {
    border-color: color-mix(in srgb, var(--green) 54%, var(--line));
    background:
        radial-gradient(circle at 1.8rem 1.4rem, color-mix(in srgb, var(--green) 18%, transparent), transparent 5rem),
        linear-gradient(135deg, color-mix(in srgb, var(--green) 18%, var(--surface-strong)), color-mix(in srgb, var(--gold) 7%, var(--surface-strong)));
    box-shadow: 0 18px 44px color-mix(in srgb, var(--green) 14%, rgba(0, 0, 0, 0.32));
}

.message-success::before {
    background: var(--green);
    color: var(--bg);
    content: "✓";
}

.message-success::after {
    background: var(--green);
}

.message-warning,
.message-error {
    border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
    background: color-mix(in srgb, var(--gold) 16%, var(--surface-strong));
}

.message-warning::before,
.message-error::before {
    background: var(--gold);
    color: var(--on-gold);
    content: "!";
}

.message-warning::after,
.message-error::after {
    background: var(--gold);
}

.notification-menu {
    position: relative;
}

.notification-trigger {
    position: relative;
    display: inline-grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.notification-trigger::-webkit-details-marker {
    display: none;
}

.notification-trigger:hover,
.notification-menu[open] .notification-trigger {
    border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
    color: var(--gold);
}

.notification-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    display: grid;
    min-width: 1.1rem;
    height: 1.1rem;
    place-items: center;
    padding: 0 0.25rem;
    border: 1px solid var(--bg);
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 60;
    display: grid;
    gap: 0.55rem;
    width: min(22rem, calc(100vw - 2rem));
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 96%, #000);
    box-shadow: var(--shadow);
}

.notification-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.notification-panel-head {
    align-items: center;
}

.notification-clear {
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 800;
}

.notification-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.notification-item .notification-item-content {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.notification-item-content > strong,
.notification-item-content > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item strong,
.notification-toast strong {
    color: var(--text);
}

.notification-item strong {
    font-size: 0.82rem;
    line-height: 1.25;
}

.notification-item span {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.3;
}

.notification-toast p,
.notification-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.notification-success {
    border-color: color-mix(in srgb, var(--green) 48%, var(--line));
}

.notification-warning {
    border-color: color-mix(in srgb, var(--gold) 56%, var(--line));
}

.notification-item-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
}

.notification-item-actions form {
    margin: 0;
}

.notification-read-button {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--green);
    cursor: pointer;
}

.notification-close-button {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 92%, #000);
    color: var(--muted);
    cursor: pointer;
}

.notification-close-button:hover {
    color: var(--gold);
    border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
}

.notification-toasts {
    position: fixed;
    top: 5.2rem;
    left: 1rem;
    z-index: 70;
    display: grid;
    gap: 0.55rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

.notification-toast {
    position: relative;
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.82rem 0.92rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 92%, #000);
    box-shadow: var(--shadow);
    animation: toast-in 220ms ease-out both;
    overflow: hidden;
    pointer-events: auto;
    touch-action: pan-y;
    will-change: transform, opacity;
}

.nav-submenu-label {
    display: block;
    padding: .45rem .65rem .2rem;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-submenu-label:not(:first-child) {
    margin-top: .25rem;
    border-top: 1px solid var(--line);
}

/* Situação do aluno: filtros explícitos e compactos. */
.student-status-filters {
    display: flex;
    align-items: center;
    gap: .55rem 1rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.student-status-filters .check-line {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 2.35rem;
    margin: 0;
    white-space: nowrap;
}

.student-list-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: end;
}

.student-list-toolbar .student-live-search {
    width: 100%;
    min-width: 0;
}

.student-state-label {
    color: var(--text-color);
    font-weight: 700;
}

@media (max-width: 640px) {
    .student-status-filters {
        width: 100%;
        flex-wrap: wrap;
    }
}

.notification-toast::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--orange));
    content: "";
    transform: scaleX(1);
    transform-origin: left;
    animation: notification-toast-progress var(--notification-dismiss-delay, 6500ms) linear forwards;
}

.notification-toast.is-leaving {
    animation: toast-out 180ms ease-in forwards;
}

.notification-toast.is-leaving-left {
    animation: toast-out-left 180ms ease-in forwards;
}

.notification-toast.is-leaving-right {
    animation: toast-out-right 180ms ease-in forwards;
}

.notification-toast.is-swiping {
    transition: none;
}

.notification-toast.is-snapping {
    transition: transform 160ms ease, opacity 160ms ease;
}

.notification-toast.is-swiping::after,
.notification-toast.is-leaving::after {
    animation-play-state: paused;
}

.notification-toast .bell-icon {
    margin-top: 0.15rem;
    color: var(--gold);
}

.app-confirm {
    width: min(30rem, calc(100% - 2rem));
    max-width: none;
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
    animation: fade-in 160ms ease-out both;
}

.app-confirm::backdrop {
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(6px);
}

.app-confirm-card {
    display: grid;
    gap: 0.85rem;
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: var(--radius-sm);
    padding: 1.1rem;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    animation: popover-in 170ms ease-out both;
}

.app-confirm-card h2,
.app-confirm-card p {
    margin: 0;
}

.app-confirm-card p {
    color: var(--muted);
}

.app-confirm-preview {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    max-height: min(14rem, 38vh);
    overflow: auto;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--teal);
    border-radius: 8px;
    background: var(--bg-soft);
}

.app-confirm-preview[hidden] {
    display: none;
}

.app-confirm-preview > span {
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-confirm-preview > strong {
    overflow-wrap: anywhere;
}

.app-confirm-preview > p {
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.app-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-0.35rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-0.35rem);
    }
}

@keyframes toast-out-left {
    to {
        opacity: 0;
        transform: translateX(-110%);
    }
}

@keyframes toast-out-right {
    to {
        opacity: 0;
        transform: translateX(110%);
    }
}

@keyframes toast-progress {
    to {
        transform: scaleX(1);
    }
}

@keyframes notification-toast-progress {
    to {
        transform: scaleX(0);
    }
}

.hero {
    position: relative;
    display: flex;
    align-items: end;
    min-height: 78svh;
    padding: 7rem 1rem 3rem;
    overflow: hidden;
    background-color: #000000;
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, 0.99), rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.78)),
        var(--hero-image);
    background-position: left center;
    background-size: cover;
}

.hero-content {
    display: grid;
    justify-items: center;
    width: min(44rem, 100%);
    margin: 0 auto;
    text-align: center;
}

.hero-brand-lockup {
    position: relative;
    width: min(19rem, 74vw);
    aspect-ratio: 1.47 / 1;
    margin: 0 auto 0.35rem;
    overflow: hidden;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.58));
}

.hero-brand-logo {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    transform: translateY(-13.2%);
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: var(--gold);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-style: italic;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2 {
    margin: 0;
    line-height: 1.04;
}

h1 {
    font-size: 3rem;
    text-transform: uppercase;
}

h2 {
    font-size: 2rem;
}

.hero-copy {
    max-width: 38rem;
    margin: 1rem auto 0;
    color: var(--text);
    font-size: 1.1rem;
}

.hero-actions,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button-primary {
    background: var(--gold);
    color: var(--on-gold);
}

.button-secondary {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    color: var(--text);
}

.button.is-static {
    cursor: default;
    opacity: 0.78;
    transform: none;
}

.button-whatsapp {
    border-color: #22c55e;
    background: #22c55e;
    color: #06120b;
}

.button-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.button-ghost:hover {
    background: color-mix(in srgb, var(--surface-strong) 64%, transparent);
    color: var(--text);
}

.button-danger-soft {
    border-color: color-mix(in srgb, #ff6767 42%, var(--line));
    background: color-mix(in srgb, #ff3434 10%, var(--surface));
    color: #ff9d9d;
}

.button-danger-soft:hover {
    background: color-mix(in srgb, #ff3434 18%, var(--surface));
    color: #ffd0d0;
}

.whatsapp-mark {
    position: relative;
    display: inline-block;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    border: 0;
    border-radius: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2325D366' stroke='%23ffffff' stroke-width='1.9' stroke-linejoin='round' d='M16.02 2.85A13.02 13.02 0 0 0 4.72 22.34L3.15 29.15l6.95-1.63A13.02 13.02 0 1 0 16.02 2.85Z'/%3E%3Cpath fill='%23ffffff' d='M22.95 19.55c-.34-.18-2.03-1-2.34-1.12-.31-.11-.54-.17-.77.17-.23.35-.88 1.12-1.08 1.35-.2.23-.4.26-.74.09-.35-.18-1.46-.54-2.78-1.71-1.03-.92-1.72-2.05-1.92-2.39-.2-.35-.02-.53.15-.7.15-.15.35-.4.52-.6.17-.2.23-.35.35-.58.11-.23.06-.43-.03-.6-.09-.18-.77-1.86-1.05-2.54-.28-.67-.56-.57-.77-.58h-.66c-.23 0-.6.09-.92.43-.31.35-1.2 1.17-1.2 2.86s1.23 3.32 1.4 3.55c.17.23 2.42 3.7 5.87 5.18.82.35 1.46.57 1.96.72.82.26 1.56.22 2.15.14.66-.1 2.03-.83 2.32-1.62.28-.79.28-1.46.2-1.61-.09-.15-.31-.23-.66-.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
    color: transparent;
    box-shadow: none;
}

.whatsapp-float {
    position: fixed;
    right: max(1rem, calc((100vw - 74rem) / 2 - 4.35rem));
    bottom: 1.25rem;
    z-index: 35;
    display: inline-grid;
    align-items: center;
    justify-content: center;
    width: 3.65rem;
    height: 3.65rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 0.75rem 1.8rem rgba(0, 0, 0, 0.3);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.whatsapp-float .whatsapp-mark {
    width: 3.45rem;
    height: 3.45rem;
    flex-basis: 3.45rem;
}

.whatsapp-float:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
}

.section {
    padding: 2.8rem 1rem;
}

.section-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.section-heading {
    max-width: 42rem;
}

.two-columns,
.split-simple {
    display: grid;
    gap: 1.5rem;
}

.intro-band,
.quiet-band,
.scan-band {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border-block: 1px solid var(--line);
}

.feature-list,
.portal-preview,
.scan-grid,
.student-grid,
.student-layout,
.progress-list,
.clean-list {
    display: grid;
    gap: 1rem;
}

.feature-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.feature-item p,
.panel p,
.compact-section p {
    margin: 0;
    color: var(--muted);
}

.note-dot {
    color: var(--gold);
    font-size: 1.4rem;
}

.scan-grid {
    grid-template-columns: 1fr;
}

.scan-card {
    position: relative;
    display: grid;
    gap: 0.45rem;
    min-height: 8rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
    transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.scan-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--green) 62%, transparent), transparent 70%);
    opacity: 0.62;
}

.scan-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--gold) 36%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 84%, var(--surface));
}

.scan-icon {
    position: relative;
    display: inline-grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
    border-radius: 999px;
    color: var(--gold);
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.12), transparent 1rem),
        color-mix(in srgb, var(--gold) 11%, transparent);
}

.scan-icon::before,
.scan-icon::after {
    content: "";
    position: absolute;
}

.scan-icon-1::before {
    left: 0.74rem;
    top: 0.52rem;
    width: 1.1rem;
    height: 1.42rem;
    border: 1.7px solid currentColor;
    border-radius: 0.18rem;
    background:
        linear-gradient(currentColor, currentColor) 0.24rem 0.38rem / 0.62rem 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) 0.24rem 0.68rem / 0.52rem 1.5px no-repeat,
        color-mix(in srgb, var(--surface) 72%, transparent);
}

.scan-icon-1::after {
    content: "\266A";
    position: absolute;
    right: 0.54rem;
    bottom: 0.48rem;
    color: var(--gold-strong);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1;
}

.scan-icon-2::before {
    inset: 0.62rem;
    border: 1.8px solid currentColor;
    border-radius: 999px;
    background: color-mix(in srgb, var(--green) 13%, transparent);
}

.scan-icon-2::after {
    content: "✓";
    position: static;
    color: var(--green);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}

.scan-icon-3::before {
    left: 0.58rem;
    top: 0.72rem;
    width: 1.55rem;
    height: 1.02rem;
    border: 1.8px solid currentColor;
    border-radius: 0.28rem;
    background:
        radial-gradient(circle, currentColor 0 0.08rem, transparent 0.09rem) 0.34rem 0.42rem / 0.28rem 0.28rem no-repeat,
        radial-gradient(circle, currentColor 0 0.08rem, transparent 0.09rem) 0.65rem 0.42rem / 0.28rem 0.28rem no-repeat,
        radial-gradient(circle, currentColor 0 0.08rem, transparent 0.09rem) 0.96rem 0.42rem / 0.28rem 0.28rem no-repeat;
}

.scan-icon-3::after {
    left: 1.02rem;
    top: 1.66rem;
    width: 0.42rem;
    height: 0.42rem;
    border-left: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    background: var(--surface);
    transform: rotate(-45deg);
}

.scan-card h2 {
    font-size: 1.35rem;
}

.scan-card p {
    margin: 0;
    color: var(--muted);
}

.accordion-list {
    display: grid;
    gap: 0.7rem;
}

.accordion-list details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.accordion-list summary {
    cursor: pointer;
    padding: 1rem;
    color: var(--text);
    font-weight: 700;
}

.accordion-list p {
    margin: 0;
    padding: 0 1rem 1rem;
    color: var(--muted);
}

.portal-preview {
    margin-top: 1.5rem;
}

.preview-panel,
.panel,
.login-panel {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.preview-panel::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 1px;
    width: calc(100% - 2px);
    height: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--green) 62%, transparent), transparent 70%);
    opacity: 0.62;
    pointer-events: none;
}

.preview-panel {
    display: grid;
    gap: 0.35rem;
    min-height: 8.5rem;
    padding: 1rem;
}

.preview-panel span,
.panel-label {
    color: var(--gold);
    font-size: 0.88rem;
    font-weight: 700;
}

.label-with-icon,
.card-kicker {
    display: inline-flex;
    gap: 0.42rem;
    align-items: center;
}

.label-with-icon .nav-icon,
.card-kicker .nav-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.preview-panel strong {
    font-size: 1.35rem;
}

.preview-panel small {
    color: var(--muted);
}

.mini-progress,
.progress-bar {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 8px;
    background: color-mix(in srgb, var(--muted) 20%, transparent);
}

.mini-progress span,
.progress-bar span {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--green));
}

.image-band img {
    width: 100%;
    max-height: 32rem;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.quick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.quick-list span {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
}

.compact-section {
    width: min(46rem, 100%);
}

.contact-band {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 88%, var(--teal)), var(--surface));
}

.partner-band {
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 16rem),
        color-mix(in srgb, var(--surface-strong) 72%, transparent);
    border-block: 1px solid var(--line);
}

.partner-panel {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.35rem;
    border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: var(--shadow);
}

.partner-panel div {
    max-width: 48rem;
}

.partner-panel p:not(.eyebrow) {
    margin: 0.75rem 0 0;
    color: var(--muted);
}

.login-shell {
    display: grid;
    min-height: calc(100svh - 5rem);
    place-items: center;
    padding: 3rem 1rem;
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.52)),
        var(--hero-image);
    background-position: center;
    background-size: cover;
}

.login-panel {
    display: grid;
    gap: 0.58rem;
    width: min(25rem, 100%);
    padding: 1.25rem;
}

.login-brand-logo {
    width: min(14rem, 72vw);
    height: auto;
    display: block;
    justify-self: center;
    margin: 0 auto -0.28rem;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5));
}

.login-panel h1 {
    font-size: 2rem;
}

.login-panel label {
    color: var(--muted);
    font-weight: 700;
}

.login-panel input {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--bg);
    color: var(--text);
    font: inherit;
}

.login-separator {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.65rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.login-separator::before,
.login-separator::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.google-login-button {
    justify-content: center;
}

.login-panel .login-remember {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.48rem;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 750;
}

.login-panel .login-remember input {
    width: 1.05rem;
    min-height: 1.05rem;
    margin: 0;
    padding: 0;
    accent-color: var(--gold);
}

.login-small-link {
    justify-self: center;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.login-small-link:hover {
    color: var(--gold);
}

.signup-panel {
    width: min(31rem, 100%);
}

.google-dot {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background:
        conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
    box-shadow: inset 0 0 0 0.28rem var(--surface);
}

.password-wrap {
    position: relative;
    display: grid;
}

.password-wrap input {
    padding-right: 3.1rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    display: inline-grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--gold);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.password-toggle-icon {
    position: relative;
    display: block;
    width: 1.05rem;
    height: 0.68rem;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.password-toggle-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 0.28rem;
    height: 0.28rem;
    margin: auto;
    border-radius: 50%;
    background: currentColor;
}

.password-toggle.is-visible .password-toggle-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -0.25rem;
    right: -0.25rem;
    border-top: 2px solid currentColor;
    transform: rotate(-35deg);
}

.form-errors {
    padding: 0.8rem;
    border: 1px solid rgba(244, 179, 33, 0.45);
    border-radius: 8px;
    color: var(--gold);
}

.student-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 1rem;
    padding: 2rem 1rem;
    background:
        linear-gradient(120deg, rgba(0, 0, 0, 0.68), transparent),
        var(--surface);
    border-bottom: 1px solid var(--line);
}

.student-hero::after {
    content: "\266A";
    position: absolute;
    right: clamp(1.2rem, 7vw, 7rem);
    top: 50%;
    width: 4.2rem;
    height: 4.2rem;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.3rem;
    opacity: 0.18;
    transform: translateY(-50%) rotate(-8deg);
    pointer-events: none;
}

.student-calendar-view .student-hero::after {
    content: "";
    border-radius: 0.9rem;
    border-color: color-mix(in srgb, var(--blue) 42%, transparent);
    color: var(--blue);
    background:
        linear-gradient(currentColor, currentColor) 50% 32% / 58% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 28% 18% / 2px 20% no-repeat,
        linear-gradient(currentColor, currentColor) 72% 18% / 2px 20% no-repeat;
    box-shadow: inset 0 0 0 2px currentColor;
}

.student-materials-view .student-hero::after {
    content: "";
    border-radius: 0.9rem;
    border-color: color-mix(in srgb, var(--gold) 46%, transparent);
    background:
        linear-gradient(var(--gold), var(--gold)) 28% 27% / 35% 14% no-repeat,
        linear-gradient(var(--gold), var(--gold)) 50% 56% / 68% 42% no-repeat;
}

.student-submissions-view .student-hero::after {
    content: "";
    border-color: color-mix(in srgb, var(--rose) 42%, transparent);
    border-radius: 1.2rem;
    box-shadow: inset 0 0 0 2px var(--rose);
}

.student-submissions-view .student-hero::before {
    content: "";
    position: absolute;
    right: clamp(2.4rem, 8.3vw, 8rem);
    top: calc(50% + 1.2rem);
    width: 0.9rem;
    height: 0.9rem;
    border-left: 2px solid var(--rose);
    border-bottom: 2px solid var(--rose);
    opacity: 0.18;
    transform: rotate(-35deg);
}

.teacher-page {
    background:
        radial-gradient(circle at 90% 8%, rgba(64, 209, 177, 0.08), transparent 24rem),
        linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.teacher-hero {
    padding: 2.4rem 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.68), transparent),
        var(--surface);
}

.teacher-hero-inner,
.teacher-grid,
.teacher-section {
    width: min(1120px, 100%);
    margin-inline: auto;
}

.teacher-hero h1 {
    font-size: 2.2rem;
    text-transform: none;
}

.teacher-hero p {
    max-width: 46rem;
    margin: 0.8rem 0 0;
    color: var(--muted);
}

.teacher-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
}

.teacher-card {
    --card-accent: var(--gold);
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0.4rem;
    min-height: 8rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.teacher-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--card-accent);
    opacity: 0.78;
}

.teacher-card.accent-students {
    --card-accent: var(--gold);
}

.teacher-card.accent-calendar {
    --card-accent: var(--teal);
}

.teacher-card.accent-billing {
    --card-accent: var(--green);
}

.teacher-card.accent-submissions {
    --card-accent: #ff8a8a;
}

.teacher-card span {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
}

.teacher-card .card-kicker {
    color: color-mix(in srgb, var(--card-accent) 82%, var(--text));
}

.teacher-card strong {
    font-size: 2rem;
    line-height: 1;
}

.teacher-card small,
.teacher-card a {
    color: var(--muted);
    text-decoration: none;
}

.teacher-card a:hover,
.teacher-card.card-link:hover small {
    color: var(--text);
}

.teacher-card.card-link {
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.teacher-card.card-link:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--card-accent) 44%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 86%, var(--surface));
    box-shadow: 0 18px 46px color-mix(in srgb, var(--card-accent) 12%, rgba(0, 0, 0, 0.36));
}

.teacher-card.card-link:hover .nav-icon,
.student-quick-panel.card-link:hover .nav-icon,
.scan-card:hover .scan-icon {
    animation: icon-lift 520ms ease both;
}

.teacher-section {
    display: grid;
    gap: 1rem;
    padding: 0 1rem 3rem;
}

.teacher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.student-hero > div,
.student-hero form,
.student-grid,
.student-section .section-inner {
    width: min(1120px, 100%);
    margin-inline: auto;
}

.student-hero h1 {
    font-size: 2.1rem;
    text-transform: none;
}

.student-hero p {
    margin: 0.8rem 0 0;
    color: var(--muted);
}

.compact-hero {
    padding-block: 1.6rem;
}

.student-title-row {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.avatar {
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
}

.avatar-button {
    display: inline-flex;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: zoom-in;
}

.avatar-button:focus-visible,
.profile-photo-preview:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.avatar-fallback {
    display: inline-grid;
    place-items: center;
    color: var(--on-gold);
    background: var(--gold);
    font-weight: 800;
}

.study-toggle-form {
    position: relative;
    justify-self: start;
}

.study-toggle-button {
    position: relative;
    overflow: visible;
    gap: 0.45rem;
}

.study-toggle-form.is-studied .study-toggle-button {
    background: var(--green);
    color: #06110f;
}

.study-confirm {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    z-index: 8;
    display: grid;
    gap: 0.75rem;
    width: min(20rem, calc(100vw - 2rem));
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.study-confirm[hidden] {
    display: none;
}

.study-confirm p {
    margin: 0;
    color: var(--text);
}

.study-confirm div {
    display: flex;
    gap: 0.5rem;
    justify-content: end;
}

.student-grid {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
}

.student-section {
    padding-top: 1.25rem;
}

.panel {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
}

.panel-link {
    color: inherit;
    text-decoration: none;
}

.panel-link:hover,
.panel-link:focus-visible {
    border-color: color-mix(in srgb, var(--gold) 46%, var(--line));
    background: color-mix(in srgb, var(--gold) 8%, var(--surface));
}

.panel strong {
    font-size: 1.2rem;
}

.panel > h2 {
    font-size: 1.55rem;
    line-height: 1.18;
}

.panel-heading {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.panel-heading h2 {
    margin-top: 0.2rem;
    font-size: 1.4rem;
}

.student-layout {
    grid-template-columns: 1fr;
}

.wide-panel {
    min-width: 0;
}

.panel,
.panel-heading,
.student-layout,
.student-section .section-inner,
.student-calendar-page,
.student-materials-page,
.student-calendar-action-grid,
.student-subnav,
.week-row,
.calendar-weekdays,
.calendar-grid {
    min-width: 0;
}

.week-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(2.4rem, 1fr));
    gap: 0.45rem;
}

.day-pill {
    display: grid;
    gap: 0.25rem;
    min-height: 4.2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
    color: var(--muted);
}

.day-pill.is-studied {
    border-color: color-mix(in srgb, var(--green) 75%, var(--line));
    background: color-mix(in srgb, var(--green) 22%, var(--surface));
    color: var(--text);
}

.day-pill.is-today {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.calendar-panel {
    gap: 0.75rem;
    overflow: hidden;
}

.calendar-heading {
    align-items: start;
}

.calendar-tabs {
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
}

.calendar-tabs a {
    min-width: 4rem;
    padding: 0.38rem 0.55rem;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.calendar-tabs a:hover,
.calendar-tabs a.is-active {
    background: var(--gold);
    color: var(--on-gold);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    min-width: 0;
}

.calendar-weekdays span {
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--line);
    border-bottom: 0;
    background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    display: grid;
    align-content: start;
    gap: 0.25rem;
    min-height: 4.5rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 0;
    margin: -1px 0 0 -1px;
    background: var(--bg-soft);
}

.calendar-day.is-outside {
    opacity: 0.45;
}

.calendar-day.is-rest {
    background: color-mix(in srgb, var(--bg-soft) 68%, var(--surface));
    opacity: 0.72;
}

.calendar-day.has-study {
    border-color: color-mix(in srgb, var(--green) 70%, var(--line));
    background: color-mix(in srgb, var(--green) 18%, var(--bg-soft));
}

.calendar-day.has-lesson {
    box-shadow: inset 3px 0 0 var(--gold);
}

.calendar-day.is-today {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

.calendar-day-top {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: space-between;
}

.calendar-day-top strong {
    font-size: 0.9rem;
}

.calendar-day-top span {
    color: var(--gold);
    font-size: 0.66rem;
    font-weight: 800;
}

.calendar-tags {
    display: grid;
    gap: 0.18rem;
}

.calendar-tag {
    max-width: 100%;
    overflow: hidden;
    padding: 0.14rem 0.28rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-tag.lesson {
    background: var(--gold);
    color: var(--on-gold);
}

.calendar-tag.study {
    background: var(--green);
    color: #06110f;
}

.calendar-tag.rest {
    background: color-mix(in srgb, var(--muted) 16%, transparent);
    color: var(--muted);
}

.clean-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.clean-list li {
    display: grid;
    gap: 0.15rem;
    padding-block: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.clean-list li:last-child {
    border-bottom: 0;
}

.clean-list span,
.progress-title span {
    color: var(--muted);
}

.progress-title {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.account-grid {
    display: grid;
    gap: 1rem;
}

.account-form {
    align-content: start;
}

.field-grid {
    display: grid;
    gap: 0.8rem;
}

.field-stack {
    display: grid;
    gap: 0.35rem;
}

.account-form label {
    color: var(--muted);
    font-weight: 700;
}

.account-form input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.account-form input[type="file"] {
    padding: 0.55rem;
}

.account-form input[type="file"]::file-selector-button {
    margin-right: 0.7rem;
    padding: 0.48rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-strong);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.account-form input[type="file"]::file-selector-button:hover {
    border-color: color-mix(in srgb, var(--gold) 60%, var(--line));
    color: var(--gold);
}

.profile-photo-editor {
    display: grid;
    gap: 0.75rem;
    justify-items: center;
    text-align: center;
}

.profile-photo-preview {
    display: inline-grid;
    width: 7.5rem;
    height: 7.5rem;
    place-items: center;
    overflow: hidden;
    border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line));
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 4.8rem),
        var(--bg-soft);
    color: var(--muted);
    cursor: pointer;
}

.profile-photo-preview.is-dragging {
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 14%, var(--surface));
}

.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-empty {
    display: grid;
    gap: 0.05rem;
    padding: 0.8rem;
    text-align: center;
}

.profile-photo-empty strong {
    color: var(--gold);
    font-size: 2.4rem;
    line-height: 1;
}

.profile-photo-empty span {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 800;
}

.profile-photo-empty small,
.field-help {
    color: var(--muted);
    font-size: 0.86rem;
}

.profile-photo-input {
    display: none;
}

.input-with-icon {
    position: relative;
}

.input-with-icon > span {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #1fa855;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.input-with-icon input {
    padding-left: 2.75rem;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.76);
}

.photo-lightbox[hidden] {
    display: none;
}

.photo-lightbox-frame {
    position: relative;
    width: min(28rem, 92vw);
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.photo-lightbox-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-lightbox-back {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 1;
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.35rem;
}

.account-form ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (min-width: 760px) {
    .site-header {
        grid-template-columns: auto 1fr auto auto;
        padding-inline: 1.5rem;
    }

    .main-nav {
        grid-column: auto;
        grid-row: 1;
        justify-content: center;
        padding-bottom: 0;
    }

    .admin-nav-menu {
        grid-column: auto;
        grid-row: 1;
        justify-self: end;
    }

    .theme-toggle {
        grid-column: auto;
        grid-row: 1;
    }

    .account-nav {
        grid-column: auto;
        grid-row: 1;
    }

    .hero {
        min-height: 80svh;
        padding-inline: 2rem;
    }

    .hero-content {
        margin-inline: auto;
    }

    h1 {
        font-size: 4.4rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    .section {
        padding: 4.5rem 2rem;
    }

    .two-columns,
    .split-simple {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        align-items: center;
    }

    .scan-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portal-preview,
    .student-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }


    .student-hero {
        grid-template-columns: 1fr auto;
        align-items: end;
        padding-inline: 2rem;
    }

    .student-hero > div,
    .student-hero form {
        width: auto;
        margin-inline: 0;
    }

    .study-toggle-form {
        justify-self: end;
    }

    .student-grid {
        padding: 1.5rem 2rem;
    }

    .student-section {
        padding-top: 1.5rem;
    }

    .teacher-hero {
        padding-inline: 2rem;
    }

    .teacher-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 1.5rem 2rem;
    }

    .teacher-section {
        padding-inline: 2rem;
    }

    .student-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wide-panel {
        grid-column: 1 / -1;
    }
}

.student-hero .eyebrow,
.teacher-hero .eyebrow {
    margin-bottom: 0.75rem;
}

.student-title-row {
    margin-top: 0;
}

.student-title-row + p {
    margin-top: 0.75rem;
}

.student-grid {
    align-items: stretch;
}

.student-grid > .panel {
    min-height: 10rem;
}

.single-account-grid {
    max-width: 48rem;
}

.account-form input,
.account-form select,
.account-form textarea,
.search-form input,
.search-form select,
.weekly-plan-form textarea,
.weekly-plan-form select,
.material-picker input,
.material-picker button,
.topic-card input,
.topic-card select,
.topic-card textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.account-form select,
.search-form select,
.weekly-plan-form select,
.topic-card select,
.compact-streak-form select,
.sync-preferences select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.45rem;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 1.18rem) 50%,
        calc(100% - 0.82rem) 50%;
    background-size: 0.38rem 0.38rem, 0.38rem 0.38rem;
    background-repeat: no-repeat;
}

.account-form select::-ms-expand,
.search-form select::-ms-expand,
.weekly-plan-form select::-ms-expand,
.topic-card select::-ms-expand,
.compact-streak-form select::-ms-expand,
.sync-preferences select::-ms-expand {
    display: none;
}

.account-form textarea {
    min-height: 7rem;
    resize: vertical;
}

.weekly-plan-form textarea,
.topic-card textarea {
    min-height: 5rem;
    resize: vertical;
}

.account-form input[type="checkbox"] {
    width: 1.1rem;
    min-height: 1.1rem;
    accent-color: var(--gold);
}

.account-form input[type="file"] {
    padding: 0.55rem;
}

.profile-photo-empty {
    gap: 0;
}

.profile-photo-empty strong {
    font-size: 2.25rem;
}

.profile-photo-empty span {
    font-size: 0.78rem;
}

.teacher-hero-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    justify-content: space-between;
}

.two-panel-section {
    grid-template-columns: 1fr;
    align-items: start;
}

.narrow-section {
    width: min(720px, 100%);
}

.teacher-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    justify-content: space-between;
}

.compact-toolbar {
    align-items: center;
}

.search-form {
    display: flex;
    flex: 1 1 24rem;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: end;
}

.search-form label {
    flex: 0 0 100%;
    color: var(--muted);
    font-weight: 700;
}

.search-form input {
    flex: 1 1 16rem;
}

.teacher-list {
    display: grid;
    gap: 0.75rem;
}

.teacher-list-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.teacher-list-avatar {
    display: inline-grid;
    place-items: center;
    color: inherit;
    text-decoration: none;
}

.avatar-small {
    width: 2.85rem;
    height: 2.85rem;
    border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.teacher-list-card:has(.teacher-list-main:hover),
.teacher-list-card:has(.teacher-list-main:focus-visible) {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--gold) 34%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 84%, var(--surface));
}

.stacked-card {
    align-items: start;
}

.teacher-list-main {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
    padding-block: 0.2rem;
    text-decoration: none;
}

.teacher-list-main strong {
    color: var(--text);
}

.teacher-list-main span,
.teacher-list-main small {
    color: var(--muted);
    min-width: 0;
}

.teacher-list-main:hover strong {
    color: var(--gold);
}

.view-toggle {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    min-height: 3rem;
    padding: 0.24rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.view-toggle button {
    display: inline-grid;
    width: 2.35rem;
    min-height: 2.35rem;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.view-toggle button:hover,
.view-toggle button.is-active {
    background: color-mix(in srgb, var(--gold) 18%, transparent);
    color: var(--text);
}

.teacher-list.is-grid-view {
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.teacher-list.is-grid-view .teacher-list-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.55rem;
    min-height: 12rem;
    text-align: center;
}

.teacher-list.is-grid-view .teacher-list-avatar .avatar {
    width: 4.6rem;
    height: 4.6rem;
    font-size: 1.5rem;
}

.teacher-list.is-grid-view .teacher-list-main {
    justify-items: center;
    width: 100%;
    max-width: 100%;
}

.teacher-list.is-grid-view .teacher-list-main strong {
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.94rem;
    line-height: 1.18;
}

.teacher-list.is-grid-view .teacher-list-main span {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    line-height: 1.25;
}

.teacher-list.is-grid-view .teacher-list-main small {
    font-size: 0.74rem;
    line-height: 1.25;
}

.teacher-list.is-grid-view .teacher-list-card form {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
}

.icon-button {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
}

.icon-button:hover {
    border-color: color-mix(in srgb, var(--gold) 60%, var(--line));
    color: var(--gold);
}

.danger-button:hover,
.danger-link:hover {
    border-color: rgba(255, 101, 101, 0.65);
    color: #ff8a8a;
}

.simple-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.simple-stats div {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
}

.simple-stats strong {
    font-size: 1.5rem;
}

.simple-stats span {
    color: var(--muted);
    font-size: 0.86rem;
}

.streak-admin-list {
    display: grid;
    gap: 0.85rem;
}

.streak-admin-card,
.streak-summary-card {
    gap: 0.85rem;
}

.streak-admin-card.is-goal-met,
.streak-summary-card.is-goal-met {
    border-color: color-mix(in srgb, var(--green) 42%, var(--line));
    background:
        radial-gradient(circle at 3rem 2rem, color-mix(in srgb, var(--green) 12%, transparent), transparent 7rem),
        var(--surface);
}

.streak-admin-card.is-disabled,
.streak-summary-card.is-disabled {
    opacity: 0.78;
}

.streak-admin-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
}

.streak-admin-main h2 {
    margin: 0.1rem 0;
}

.teacher-own-streak {
    margin-bottom: 1rem;
    border-color: color-mix(in srgb, var(--gold) 34%, var(--line));
    background:
        radial-gradient(circle at 2rem 2rem, color-mix(in srgb, var(--gold) 12%, transparent), transparent 7rem),
        color-mix(in srgb, var(--surface-strong) 86%, var(--surface));
}

.teacher-own-streak.streak-panel {
    gap: 1rem;
}

.streak-panel.is-disabled {
    opacity: 0.78;
}

.teacher-streak-heading {
    align-items: flex-start;
    gap: 1rem;
}

.teacher-streak-heading > form {
    margin: 0;
    justify-self: end;
}

.teacher-own-streak .streak-admin-main {
    align-items: flex-start;
}

.teacher-streak-settings {
    margin-top: 0.1rem;
}

.teacher-streak-settings-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding-top: 0.65rem;
}

.teacher-streak-settings .compact-streak-form {
    align-items: end;
}

.streak-admin-progress {
    display: grid;
    gap: 0.45rem;
}

.streak-teacher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: end;
    justify-content: space-between;
}

.streak-teacher-actions form {
    margin: 0;
}

.compact-streak-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: end;
}

.compact-streak-form label:not(.check-row) {
    display: grid;
    gap: 0.25rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.compact-streak-form select {
    min-height: 2.35rem;
    padding: 0 0.65rem;
}

.button[disabled] {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
}

.inline-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
}

.inline-details + .inline-details {
    margin-top: 0.65rem;
}

.inline-details summary {
    cursor: pointer;
    padding: 0.75rem 0.85rem;
    color: var(--text);
    font-weight: 800;
}

.mini-form {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem;
}

.compact-list li {
    position: relative;
}

.action-list li {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.action-list li > span,
.action-list li > strong {
    grid-column: 1;
}

.action-list li > form,
.action-list li > .row-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.row-actions {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.calendar-shell {
    width: min(34rem, 100%);
    margin-inline: auto;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 2.5rem 1fr 2.5rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.calendar-toolbar strong {
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-transform: lowercase;
}

.calendar-toolbar a {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 1.6rem;
    line-height: 1;
}

.calendar-toolbar a:hover {
    background: var(--surface-strong);
    color: var(--gold);
}

.calendar-weekdays,
.calendar-grid {
    width: min(34rem, 100%);
    margin-inline: auto;
}

.calendar-weekdays {
    margin-bottom: 0.15rem;
}

.calendar-weekdays span {
    border: 0;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: none;
}

.calendar-day {
    aspect-ratio: 1;
    min-height: 0;
    padding: 0.38rem;
    border-color: transparent;
    background: transparent;
}

.calendar-day:hover {
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.calendar-day.is-outside {
    opacity: 0.34;
}

.calendar-day.is-rest {
    background: transparent;
    opacity: 0.55;
}

.calendar-day.has-study {
    border-color: transparent;
    background: transparent;
    box-shadow: inset 0 -3px 0 var(--green);
}

.calendar-day.is-today {
    outline: 2px solid #00a8ff;
    outline-offset: -3px;
}

.calendar-day.has-lesson {
    box-shadow: inset 0 -3px 0 var(--gold);
}

.calendar-day.has-event {
    box-shadow: inset 0 -3px 0 var(--teal);
}

.calendar-day.has-fee {
    box-shadow: inset 0 -3px 0 var(--green);
}

.calendar-day.has-lesson.has-event,
.calendar-day.has-lesson.has-fee,
.calendar-day.has-event.has-fee {
    box-shadow:
        inset 0 -3px 0 var(--gold),
        inset 0 -6px 0 var(--teal);
}

.calendar-day-top {
    justify-content: center;
}

.calendar-day-top strong {
    font-size: 1rem;
    font-weight: 500;
}

.calendar-day-top span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.calendar-tags {
    margin-top: auto;
}

.calendar-tag {
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.56rem;
    font-weight: 700;
    text-align: center;
}

.calendar-tag.lesson,
.calendar-tag.event,
.calendar-tag.fee,
.calendar-tag.study,
.calendar-tag.rest {
    background: transparent;
}

.calendar-tag.lesson {
    color: var(--gold);
}

.calendar-tag.event {
    color: var(--teal);
}

.calendar-tag.fee,
.calendar-tag.study {
    color: var(--green);
}

.calendar-tabs {
    align-self: start;
}

@media (min-width: 760px) {
    .two-panel-section {
        grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.82fr);
    }

    .narrow-section {
        padding-inline: 2rem;
    }

    .single-account-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-tabbar {
    display: none;
}

@media (max-width: 759px) {
    body {
        width: 100%;
    }

    .public-page:not(.is-authenticated) .site-header {
        grid-template-columns: minmax(0, 1fr) auto auto auto;
        gap: 0.45rem;
    }

    .public-page:not(.is-authenticated) .public-main-nav {
        display: none;
    }

    .public-mobile-menu {
        position: relative;
        grid-column: 2;
        grid-row: 1;
        display: inline-block;
        justify-self: end;
    }

    .public-mobile-menu summary {
        display: inline-grid;
        width: 2.45rem;
        height: 2.45rem;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
        color: var(--gold);
        cursor: pointer;
        list-style: none;
        -webkit-tap-highlight-color: transparent;
    }

    .public-mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .public-mobile-menu[open] summary {
        border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
        background: color-mix(in srgb, var(--gold) 14%, var(--surface));
    }

    .public-mobile-menu-panel {
        position: absolute;
        right: 0;
        top: calc(100% + 0.55rem);
        z-index: 45;
        display: grid;
        width: min(18rem, calc(100vw - 1.6rem));
        gap: 0.2rem;
        padding: 0.55rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: color-mix(in srgb, var(--surface-strong) 97%, #000000);
        box-shadow: var(--shadow);
    }

    .public-mobile-menu-panel a {
        padding: 0.7rem 0.75rem;
        border-radius: 8px;
        color: var(--text);
        font-weight: 800;
        text-decoration: none;
    }

    .public-mobile-menu-panel a:hover,
    .public-mobile-menu-panel a:active {
        background: color-mix(in srgb, var(--gold) 13%, transparent);
        color: var(--gold);
    }

    .public-mobile-menu-panel .public-mobile-subitem {
        padding-left: 1.35rem;
        color: var(--muted);
        font-size: 0.9rem;
        font-weight: 700;
    }

    .public-page:not(.is-authenticated) .account-nav {
        grid-column: 3;
        grid-row: 1;
    }

    .public-page:not(.is-authenticated) .theme-toggle {
        grid-column: 4;
        grid-row: 1;
    }

    main,
    .section,
    .section-inner,
    .student-section,
    .student-section .section-inner,
    .student-layout,
    .panel {
        max-width: 100%;
    }

    .is-authenticated {
        padding-bottom: calc(4.7rem + env(safe-area-inset-bottom));
    }

    .is-authenticated .site-header {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0.5rem;
        padding: 0.55rem 0.85rem;
    }

    .is-authenticated .main-nav {
        display: none;
    }

    .is-authenticated .account-nav {
        display: flex;
        grid-column: 2;
        grid-row: 1;
    }

    .is-authenticated .account-nav > :not(.notification-menu) {
        display: none;
    }

    .is-authenticated.is-staff .admin-nav-menu {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
    }

    .is-authenticated.is-staff .admin-nav-trigger {
        width: 100%;
        justify-content: center;
    }

    .is-authenticated.is-staff .admin-nav-panel {
        left: 0;
        grid-template-columns: 1fr;
        width: 100%;
        transform: none;
    }

    .is-authenticated .theme-toggle {
        grid-column: 3;
        grid-row: 1;
        width: 2.35rem;
        height: 2.35rem;
    }

    .is-authenticated .notification-panel {
        position: fixed;
        top: 4.2rem;
        right: 0.75rem;
        width: min(22rem, calc(100vw - 1.5rem));
    }

    .is-authenticated .brand {
        max-width: 100%;
    }

    .is-authenticated .brand-symbol {
        font-size: 1.65rem;
    }

    .is-authenticated .brand strong {
        font-size: 0.92rem;
    }

    .notification-toasts {
        top: max(0.75rem, env(safe-area-inset-top));
        bottom: auto;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
    }

    .notification-toast {
        padding: 0.75rem 0.82rem;
        border-radius: 12px;
    }

    .is-authenticated .brand small {
        font-size: 0.78rem;
    }

    .mobile-tabbar {
        position: fixed;
        right: max(0.65rem, env(safe-area-inset-right));
        bottom: max(0.55rem, env(safe-area-inset-bottom));
        left: max(0.65rem, env(safe-area-inset-left));
        z-index: 35;
        display: flex;
        gap: 0.2rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 0.42rem;
        border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
        border-radius: 18px;
        background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
        backdrop-filter: blur(18px);
        scrollbar-width: none;
    }

    .mobile-tabbar::-webkit-scrollbar {
        display: none;
    }

    .mobile-tabbar-form {
        flex: 0 0 auto;
        margin: 0;
    }

    .mobile-tabbar-item {
        display: grid;
        flex: 0 0 3rem;
        min-width: 3rem;
        min-height: 3rem;
        place-items: center;
        gap: 0;
        padding: 0.32rem 0.1rem;
        border: 1px solid transparent;
        border-radius: 14px;
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-size: 0.6rem;
        font-weight: 800;
        line-height: 1.05;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        scroll-snap-align: center;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-tabbar-item .nav-icon {
        width: 1.28rem;
        height: 1.28rem;
    }

    .mobile-tabbar-item > span:not(.nav-icon) {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .mobile-tabbar-item.is-active {
        border-color: color-mix(in srgb, var(--gold) 34%, transparent);
        background: color-mix(in srgb, var(--gold) 14%, var(--surface));
        color: var(--gold-strong);
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, var(--gold) 18%, transparent),
            0 0 0 1px color-mix(in srgb, var(--gold) 8%, transparent);
    }

    .mobile-tabbar-item:active,
    .mobile-tabbar-item:hover {
        color: var(--gold);
        background: color-mix(in srgb, var(--surface) 80%, transparent);
    }

    .student-calendar-card {
        scroll-margin-top: 5.2rem;
    }

    .student-hero,
    .teacher-hero {
        padding: 1.15rem 0.85rem;
    }

    .student-hero::after {
        right: 0.7rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.6rem;
        opacity: 0.11;
    }

    .student-hero h1,
    .teacher-hero h1 {
        font-size: clamp(1.75rem, 8vw, 2.15rem);
    }

    .student-hero p,
    .teacher-hero p {
        margin-top: 0.55rem;
    }

    .student-page .student-title-row {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .study-toggle-form {
        justify-self: center;
        width: min(16rem, 100%);
    }

    .study-toggle-button {
        width: 100%;
    }

    .student-grid,
    .teacher-grid,
    .teacher-section,
    .student-section {
        padding-inline: 0.85rem;
    }

    .student-grid {
        gap: 0.75rem;
        padding-block: 0.9rem;
    }

    .student-grid > .panel,
    .student-secondary-grid > .panel {
        min-height: auto;
    }

    .student-section {
        padding-top: 0.35rem;
    }

    .panel {
        padding: 0.9rem;
    }

    .signup-request-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.85rem;
        padding: 0.9rem;
    }

    .signup-request-row strong,
    .signup-request-row span,
    .signup-request-row small {
        overflow-wrap: anywhere;
    }

    .signup-request-row .row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .signup-request-row .row-actions .button {
        width: 100%;
    }

    .panel-heading {
        align-items: flex-start;
        gap: 0.7rem;
    }

    .student-page .streak-panel {
        overflow: visible;
    }

    .student-page .streak-panel > * {
        min-width: 0;
    }

    .streak-panel .panel-heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .streak-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        justify-content: stretch;
    }

    .streak-actions .study-toggle-form,
    .streak-actions form[data-disable-streak] {
        grid-column: 1 / -1;
        width: 100%;
    }

    .streak-actions .button {
        width: 100%;
        min-height: 2.85rem;
    }

    .streak-actions form[data-disable-streak] .button {
        min-height: 2.65rem;
    }

    .streak-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.72rem;
        text-align: center;
    }

    .streak-note-badge {
        width: 3.1rem;
        height: 3.1rem;
        margin-inline: auto;
    }

    .streak-note-shape {
        width: 2rem;
        height: 2rem;
        font-size: 2rem;
    }

    .streak-hero strong {
        font-size: clamp(1.65rem, 9vw, 2.15rem);
    }

    .streak-hero p {
        max-width: 100%;
        font-size: 0.95rem;
        line-height: 1.38;
    }

    .streak-hero .streak-celebration {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }

    .streak-hero .streak-celebration strong {
        font-size: 0.95rem;
    }

    .panel strong {
        font-size: 1.08rem;
    }

    .panel-heading h2 {
        font-size: 1.18rem;
    }

    .week-row {
        grid-auto-columns: minmax(3rem, 3.45rem);
        grid-auto-flow: column;
        grid-template-columns: none;
        gap: 0.36rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        padding: 0.18rem 0.08rem 0.35rem;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .day-pill {
        width: 3.2rem;
        min-height: 4rem;
        padding: 0.45rem 0.2rem;
        scroll-snap-align: start;
    }

    .day-pill .day-icon {
        min-width: 1.35rem;
        height: 1.35rem;
        padding-inline: 0.28rem;
        font-size: 0.68rem;
    }

    .calendar-day {
        min-height: auto;
        aspect-ratio: 1;
        padding: 0.24rem 0.12rem;
        overflow: hidden;
    }

    .calendar-weekdays,
    .calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        width: 100%;
    }

    .calendar-weekdays span {
        padding-inline: 0;
        font-size: 0.68rem;
    }

    .calendar-day-top strong {
        font-size: 0.84rem;
    }

    .calendar-tags {
        display: flex;
        gap: 0.12rem;
        justify-content: center;
        min-width: 0;
    }

    .teacher-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        padding-block: 0.9rem;
    }

    .teacher-card {
        min-height: 6.6rem;
        padding: 0.85rem;
    }

    .teacher-card strong {
        font-size: 1.55rem;
    }

    .teacher-card span,
    .teacher-card a {
        font-size: 0.82rem;
    }

    .teacher-section {
        gap: 0.85rem;
        padding-bottom: 1.6rem;
    }

    .teacher-toolbar,
    .search-form {
        gap: 0.65rem;
    }

    .partner-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .partner-panel .button {
        width: 100%;
    }

    .teacher-page .search-form input,
    .teacher-page .search-form .button,
    .teacher-page .teacher-toolbar > .button {
        flex: 1 1 100%;
        width: 100%;
    }

    .teacher-hero-row {
        align-items: start;
        flex-direction: column;
    }

    .calendar-tag {
        font-size: 0;
    }

    .calendar-tag::before {
        content: "";
        display: block;
        width: 0.32rem;
        height: 0.32rem;
        margin-inline: auto;
        border-radius: 50%;
        background: currentColor;
    }
}

.icon-link {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.nav-icon {
    position: relative;
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
    color: currentColor;
}

.login-icon::before,
.login-icon::after {
    content: "";
    position: absolute;
}

.login-icon::before {
    right: 0.02rem;
    top: 0.08rem;
    width: 0.34rem;
    height: 0.78rem;
    border: 1.7px solid currentColor;
    border-left: 0;
    border-radius: 0 0.14rem 0.14rem 0;
}

.login-icon::after {
    left: 0.02rem;
    top: 0.31rem;
    width: 0.7rem;
    height: 0.34rem;
    background: currentColor;
    clip-path: polygon(0 36%, 56% 36%, 56% 0, 100% 50%, 56% 100%, 56% 64%, 0 64%);
}

.user-icon::before,
.user-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 1.7px solid currentColor;
}

.user-icon::before {
    top: 0.08rem;
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 50%;
}

.user-icon::after {
    bottom: 0.06rem;
    width: 0.7rem;
    height: 0.42rem;
    border-radius: 999px 999px 0 0;
    border-bottom: 0;
}

.power-icon {
    border: 1.7px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
}

.power-icon::before {
    content: "";
    position: absolute;
    top: -0.08rem;
    left: 50%;
    width: 1.7px;
    height: 0.54rem;
    transform: translateX(-50%);
    border-radius: 99px;
    background: currentColor;
}

.home-icon::before,
.home-icon::after,
.calendar-line-icon::before,
.calendar-line-icon::after,
.students-icon::before,
.students-icon::after,
.requests-icon::before,
.requests-icon::after,
.folder-icon::before,
.folder-icon::after,
.message-icon::before,
.message-icon::after,
.coin-icon::before,
.coin-icon::after,
.note-line-icon::before,
.note-line-icon::after {
    content: "";
    position: absolute;
}

.home-icon::before {
    left: 0.18rem;
    top: 0.42rem;
    width: 0.58rem;
    height: 0.42rem;
    border: 1.7px solid currentColor;
    border-top: 0;
    border-radius: 0 0 0.18rem 0.18rem;
}

.home-icon::after {
    left: 0.16rem;
    top: 0.15rem;
    width: 0.62rem;
    height: 0.62rem;
    border-top: 1.7px solid currentColor;
    border-left: 1.7px solid currentColor;
    border-radius: 0.16rem 0 0 0;
    transform: rotate(45deg);
    transform-origin: center;
}

.calendar-line-icon {
    border: 1.7px solid currentColor;
    border-radius: 3px;
}

.calendar-line-icon::before {
    top: 0.23rem;
    left: 0;
    right: 0;
    height: 1.7px;
    background: currentColor;
}

.calendar-line-icon::after {
    top: -0.09rem;
    left: 0.2rem;
    width: 0.12rem;
    height: 0.25rem;
    border-radius: 99px;
    background: currentColor;
    box-shadow: 0.38rem 0 0 currentColor;
}

.students-icon::before {
    top: 0.12rem;
    left: 0.13rem;
    width: 0.28rem;
    height: 0.28rem;
    border: 1.7px solid currentColor;
    border-radius: 50%;
    box-shadow: 0.39rem 0.04rem 0 -0.04rem currentColor;
}

.students-icon::after {
    left: 0.08rem;
    bottom: 0.1rem;
    width: 0.76rem;
    height: 0.38rem;
    border: 1.7px solid currentColor;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
}

.requests-icon::before {
    inset: 0.13rem 0.2rem 0.08rem;
    border: 1.7px solid currentColor;
    border-radius: 0.18rem;
    background:
        linear-gradient(currentColor, currentColor) 0.22rem 0.3rem / 0.36rem 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) 0.22rem 0.52rem / 0.28rem 1.5px no-repeat;
}

.requests-icon::after {
    content: "+";
    right: 0;
    bottom: -0.02rem;
    display: grid;
    width: 0.48rem;
    height: 0.48rem;
    place-items: center;
    border: 1.7px solid currentColor;
    border-radius: 50%;
    background: var(--surface);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
}

.folder-icon::before {
    left: 0.08rem;
    top: 0.24rem;
    width: 0.8rem;
    height: 0.52rem;
    border: 1.7px solid currentColor;
    border-radius: 3px;
}

.folder-icon::after {
    left: 0.12rem;
    top: 0.14rem;
    width: 0.32rem;
    height: 0.18rem;
    border: 1.7px solid currentColor;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.message-icon::before {
    inset: 0.12rem 0.08rem 0.22rem;
    border: 1.7px solid currentColor;
    border-radius: 4px;
}

.message-icon::after {
    left: 0.26rem;
    bottom: 0.1rem;
    width: 0.26rem;
    height: 0.26rem;
    border-left: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
    transform: rotate(-35deg);
    background: var(--surface);
}

.coin-icon::before {
    inset: 0.08rem;
    border: 1.7px solid currentColor;
    border-radius: 50%;
}

.coin-icon::after {
    left: 0.39rem;
    top: 0.24rem;
    width: 0.18rem;
    height: 0.47rem;
    border-radius: 99px;
    background: currentColor;
    box-shadow: -0.12rem 0.18rem 0 -0.06rem currentColor, 0.12rem -0.18rem 0 -0.06rem currentColor;
}

.note-line-icon::before {
    right: 0.19rem;
    top: 0.06rem;
    width: 0.15rem;
    height: 0.64rem;
    border-radius: 99px;
    background: currentColor;
    transform: rotate(-2deg);
}

.note-line-icon::after {
    left: 0.12rem;
    bottom: 0.08rem;
    width: 0.48rem;
    height: 0.34rem;
    border-radius: 50%;
    background: currentColor;
    transform: rotate(-18deg);
    box-shadow: 0.44rem -0.55rem 0 -0.17rem currentColor;
}

.streak-icon::before {
    content: "\266A";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 1.7px solid currentColor;
    border-radius: 50%;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.home-icon {
    color: var(--gold);
}

.calendar-line-icon {
    color: var(--blue);
}

.folder-icon {
    color: var(--gold-strong);
    transform: translateY(-0.02rem) scale(1.08);
}

.message-icon {
    color: var(--rose);
}

.user-icon,
.students-icon,
.requests-icon {
    color: var(--teal);
}

.note-line-icon,
.coin-icon {
    color: var(--gold);
}

.streak-icon {
    color: var(--green);
}

.doc-icon,
.history-icon {
    position: relative;
}

.doc-icon {
    color: var(--gold-strong);
}

.history-icon {
    color: var(--green);
    border: 1.7px solid currentColor;
    border-radius: 50%;
}

.doc-icon::before,
.doc-icon::after,
.history-icon::before,
.history-icon::after {
    content: "";
    position: absolute;
}

.doc-icon::before {
    inset: 0.08rem 0.16rem;
    border: 1.7px solid currentColor;
    border-radius: 3px;
}

.doc-icon::after {
    right: 0.17rem;
    top: 0.09rem;
    width: 0.26rem;
    height: 0.26rem;
    border-left: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
    transform: rotate(-90deg);
}

.history-icon::before {
    left: 0.43rem;
    top: 0.18rem;
    width: 1.7px;
    height: 0.32rem;
    border-radius: 99px;
    background: currentColor;
}

.history-icon::after {
    left: 0.43rem;
    top: 0.45rem;
    width: 0.3rem;
    height: 1.7px;
    border-radius: 99px;
    background: currentColor;
    transform: rotate(22deg);
    transform-origin: left center;
}

.back-button {
    display: block;
    width: fit-content;
    margin: 0.75rem auto 0;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
}

.back-button:hover {
    color: var(--gold);
    border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
}

.student-page .student-hero > div {
    justify-self: center;
    text-align: center;
}

.student-page .student-title-row {
    justify-content: center;
}

.student-grid {
    padding-bottom: 1.5rem;
}

.student-section {
    padding: 0 1rem 3rem;
}

.student-layout {
    align-items: start;
}

.student-calendar-card {
    grid-column: 1 / -1;
    width: min(40rem, 100%);
    justify-self: center;
}

.student-calendar-card .panel-heading {
    justify-content: center;
    text-align: center;
}

.student-calendar-card .calendar-shell,
.student-calendar-card .calendar-weekdays,
.student-calendar-card .calendar-grid {
    width: min(32rem, 100%);
}

.teacher-hero.compact-hero + .teacher-section,
.teacher-hero.compact-hero + .narrow-section {
    margin-top: 1.5rem;
}

.teacher-page .button,
.student-page .button {
    min-width: 7.25rem;
}

.button-small {
    min-width: 5.8rem !important;
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.88rem;
}

.teacher-toolbar .button,
.search-form .button {
    flex: 0 0 auto;
    min-width: 7rem;
}

.search-form {
    gap: 0.7rem;
}

.icon-button {
    text-decoration: none;
}

.checkbox-row {
    align-content: center;
}

.checkbox-row label {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    min-height: 2.75rem;
}

.profile-photo-preview {
    position: relative;
    border-style: solid;
    border-color: color-mix(in srgb, var(--muted) 34%, var(--line));
    background: var(--surface-strong);
    box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--bg-soft) 62%, transparent);
}

.profile-photo-preview[data-photo-has-image="false"]::after {
    content: "+";
    position: absolute;
    right: 0.7rem;
    bottom: 0.7rem;
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border: 2px solid var(--surface-strong);
    border-radius: 50%;
    background: var(--gold);
    color: var(--on-gold);
    font-weight: 900;
    line-height: 1;
}

.profile-photo-empty {
    place-items: center;
    color: var(--muted);
}

.profile-photo-empty span:last-child {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.photo-camera {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.62rem;
    border: 2px solid var(--gold);
    border-radius: 0.42rem;
}

.photo-camera::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 0.68rem;
    height: 0.68rem;
    margin: auto;
    border: 2px solid var(--gold);
    border-radius: 50%;
}

.photo-camera::after {
    content: "";
    position: absolute;
    top: -0.36rem;
    left: 0.42rem;
    width: 0.72rem;
    height: 0.28rem;
    border-radius: 0.22rem 0.22rem 0 0;
    background: var(--gold);
}

.calendar-day.is-rest {
    background: color-mix(in srgb, var(--surface-strong) 56%, var(--bg) 44%);
    opacity: 1;
}

.calendar-day.is-rest .calendar-day-top strong {
    color: var(--muted);
}

.calendar-day.is-holiday {
    background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}

.calendar-tag.rest {
    color: color-mix(in srgb, var(--muted) 82%, var(--text));
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    align-items: center;
    margin-top: 0.85rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.calendar-legend span {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.calendar-legend i {
    display: inline-block;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 3px;
    background: var(--line);
}

.calendar-legend .legend-study {
    background: var(--green);
}

.calendar-legend .legend-lesson {
    background: var(--gold);
}

.calendar-legend .legend-event {
    background: var(--teal);
}

.calendar-legend .legend-fee {
    background: color-mix(in srgb, var(--green) 72%, var(--gold));
}

.calendar-legend .legend-rest {
    background: color-mix(in srgb, var(--muted) 30%, var(--surface));
}

.calendar-legend .legend-today {
    border: 2px solid #00a8ff;
    background: transparent;
}

.week-toolbar {
    display: grid;
    grid-template-columns: 2.5rem 1fr 2.5rem;
    align-items: center;
    width: min(42rem, 100%);
    margin: 0 auto 0.75rem;
}

.week-toolbar strong {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.week-toolbar a {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 1.6rem;
}

.week-toolbar a:hover {
    background: var(--surface-strong);
    color: var(--gold);
}

.teacher-week {
    display: grid;
    gap: 0.55rem;
}

.teacher-week-day {
    display: grid;
    gap: 0.45rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
}

.teacher-week-day header {
    display: grid;
    gap: 0.1rem;
    justify-items: center;
}

.teacher-week-day header span,
.teacher-week-day small {
    color: var(--muted);
}

.teacher-week-day.is-today {
    outline: 2px solid #00a8ff;
    outline-offset: -2px;
}

.teacher-week-day.is-rest {
    background: color-mix(in srgb, var(--surface-strong) 62%, var(--bg) 38%);
}

.teacher-week-day.is-holiday {
    background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}

.week-item {
    display: grid;
    gap: 0.1rem;
    padding: 0.55rem;
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.week-item strong {
    font-size: 0.88rem;
    line-height: 1.25;
}

.week-item span {
    color: var(--muted);
    font-size: 0.88rem;
}

.week-item.event {
    border-left-color: var(--teal);
}

.week-item.fee {
    border-left-color: var(--green);
}

@media (min-width: 760px) {
    .student-section {
        padding: 0 2rem 3rem;
    }

    .teacher-week {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .teacher-week-day {
        min-height: 10rem;
        align-content: start;
    }
}

.main-nav a,
.account-nav a,
.link-button {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.2rem 0.45rem;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.main-nav a.is-active,
.account-nav a.is-active {
    color: var(--text);
    border-color: color-mix(in srgb, var(--line) 72%, transparent);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.main-nav a:hover,
.account-nav a:hover,
.link-button:hover {
    background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
}

.back-button {
    margin: 0.7rem 0 0 max(1rem, calc((100vw - 1120px) / 2));
    background: transparent;
    box-shadow: none;
}

.teacher-hero-inner,
.teacher-grid,
.teacher-section,
.student-hero > div,
.student-hero form,
.student-grid,
.student-section .section-inner {
    width: min(1120px, calc(100% - 2rem));
}

.teacher-grid,
.teacher-section,
.student-grid {
    padding-inline: 0;
}

.teacher-section,
.student-layout,
.student-grid,
.teacher-grid,
.teacher-list {
    gap: 1.25rem;
}

.teacher-card,
.teacher-list-card,
.panel,
.preview-panel {
    min-width: 0;
}

.teacher-grid {
    align-items: stretch;
}

.teacher-grid > .teacher-card,
.student-grid > .panel,
.calendar-overview-grid > .panel {
    height: 100%;
}

.student-grid > .panel {
    display: grid;
    align-content: start;
    min-height: 10.5rem;
}

.panel-heading.compact-heading h2 {
    font-size: 1.35rem;
}

.teacher-toolbar {
    align-items: end;
}

.search-form {
    align-items: end;
}

.teacher-page .search-form input,
.teacher-page .search-form .button,
.teacher-page .teacher-toolbar > .button {
    height: 3rem;
    min-height: 3rem;
    padding-block: 0.7rem;
}

.teacher-page .search-form input {
    flex-basis: 18rem;
}

.teacher-page .teacher-toolbar > .button {
    flex: 0 0 auto;
}

.calendar-overview-grid {
    align-items: stretch;
}

.google-calendar-panel {
    display: grid;
    align-content: start;
    gap: 0.9rem;
}

.google-calendar-panel p {
    margin: 0;
    color: var(--muted);
}

.google-calendar-panel .button {
    width: fit-content;
}

.preference-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.preference-pills button {
    min-height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.preference-pills button:hover,
.preference-pills button.is-active {
    border-color: color-mix(in srgb, var(--gold) 54%, var(--line));
    background: color-mix(in srgb, var(--gold) 14%, var(--surface));
    color: var(--text);
}

.inline-alert {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.inline-alert::before {
    display: inline-grid;
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 1.2rem;
    place-items: center;
    border-radius: 999px;
    background: var(--gold);
    color: var(--on-gold);
    font-size: 0.8rem;
    font-weight: 900;
    content: "!";
}

.warning-alert {
    color: var(--text);
    border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
}

.sync-button {
    position: relative;
}

.sync-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
}

[data-sync-form].is-syncing .sync-icon {
    animation: sync-spin 760ms linear infinite;
}

[data-sync-form].is-syncing button {
    opacity: 0.78;
    pointer-events: none;
}

@keyframes sync-spin {
    to {
        transform: rotate(360deg);
    }
}

.google-calendar-embed-panel {
    overflow: hidden;
}

.google-calendar-embed {
    width: 100%;
    min-height: 36rem;
    border: 0;
    border-radius: 8px;
    background: var(--surface);
}

.action-panel {
    align-content: start;
}

.action-details {
    border: 0;
    background: transparent;
}

.action-details summary {
    display: inline-flex;
    width: fit-content;
    min-height: 2.55rem;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
    color: var(--text);
    font-weight: 800;
    list-style: none;
}

.action-details summary::-webkit-details-marker {
    display: none;
}

.action-details summary:hover {
    border-color: color-mix(in srgb, var(--gold) 48%, var(--line));
    color: var(--gold);
}

.action-details[open] {
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.action-details[open] summary {
    margin: 0.65rem 0.65rem 0;
}

.profile-photo-preview {
    width: 9rem;
    height: 9rem;
    border-color: color-mix(in srgb, var(--muted) 42%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 92%, var(--bg));
    box-shadow: inset 0 0 0 7px color-mix(in srgb, var(--bg-soft) 70%, transparent);
}

.profile-photo-preview[data-photo-has-image="false"]::after {
    right: 0.72rem;
    bottom: 0.72rem;
    width: 1.72rem;
    height: 1.72rem;
}

.profile-photo-empty {
    gap: 0.45rem;
    padding: 0.9rem;
    place-items: center;
}

.profile-photo-empty span:last-child {
    max-width: 5.2rem;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.16;
}

.photo-camera {
    display: block;
    width: 2.45rem;
    height: 1.78rem;
    margin-inline: auto;
}

.profile-photo-menu {
    display: inline-flex;
    gap: 0.2rem;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
}

.photo-action {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    border: 0;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
}

.photo-action:hover {
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    color: var(--gold);
}

.danger-action:hover {
    color: #ff8a8a;
}

.calendar-day.has-lesson {
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    box-shadow: inset 0 -3px 0 var(--gold);
}

.calendar-day.has-fee:not(.has-lesson) {
    box-shadow: inset 0 -3px 0 var(--green);
}

.student-page .calendar-day.has-study {
    background: color-mix(in srgb, var(--green) 16%, transparent);
    box-shadow: inset 0 -3px 0 var(--green);
}

.student-page .calendar-day.has-lesson:not(.has-study) {
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    box-shadow: inset 0 -3px 0 var(--gold);
}

.calendar-day.is-rest:not(.has-lesson):not(.has-study) {
    background: color-mix(in srgb, var(--surface-strong) 58%, var(--bg) 42%);
}

.calendar-day.is-holiday:not(.has-lesson):not(.has-study) {
    background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}

@media (min-width: 760px) {
    .teacher-grid,
    .teacher-section,
    .student-grid,
    .student-section {
        padding-inline: 0;
    }

    .calendar-overview-grid {
        grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.36fr);
    }
}

html {
    scrollbar-color: color-mix(in srgb, var(--muted) 48%, var(--surface)) var(--bg);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 0.7rem;
    height: 0.7rem;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    border: 2px solid var(--bg);
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 48%, var(--surface));
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.public-page .hero {
    min-height: 66svh;
    align-items: center;
    padding-block: 2.35rem 2rem;
}

@media (min-width: 760px) {
    .public-page .hero {
        min-height: 64svh;
        padding-block: 3rem 2.2rem;
    }
}

@media (max-width: 759px) {
    .public-page .hero {
        align-items: start;
        padding: 0.85rem 0.85rem 1.15rem;
    }

    .hero-brand-lockup {
        width: min(16.75rem, 70vw);
        margin-bottom: 0.15rem;
    }

    .public-page .hero .eyebrow {
        margin-bottom: 0.25rem;
        font-size: 1.05rem;
    }

    .public-page .hero-copy {
        margin-top: 0.5rem;
        font-size: 0.95rem;
        line-height: 1.38;
    }

    .public-page .hero-actions {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        gap: 0.5rem;
        margin-top: 0.8rem;
    }

    .public-page .hero-actions .button {
        min-width: 0;
        min-height: 2.55rem;
        padding: 0.58rem 0.55rem;
        font-size: 0.88rem;
        line-height: 1.18;
        white-space: normal;
    }
}

.teacher-mini-profile {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.avatar-small {
    width: 2rem;
    height: 2rem;
}

.student-status-panel,
.billing-snapshot {
    align-content: start;
}

.billing-snapshot {
    display: grid;
    gap: 0.1rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
}

.billing-snapshot span,
.late-note,
.reported-note {
    color: var(--muted);
}

.status-late,
.status-late-row {
    border-color: rgba(255, 101, 101, 0.48) !important;
    background: color-mix(in srgb, #ff3f3f 9%, var(--surface)) !important;
}

.status-late-text strong,
.status-late strong,
.status-late-row strong,
.late-note {
    color: #ff8a8a;
}

.status-reported {
    border-color: color-mix(in srgb, var(--gold) 48%, var(--line)) !important;
    background: color-mix(in srgb, var(--gold) 10%, var(--surface)) !important;
}

.status-reported strong,
.reported-note {
    color: var(--gold);
}

.fee-report-form {
    margin-top: 0.65rem;
}

.money-field {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
}

.money-field > span {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    padding-inline: 0.75rem 0.55rem;
    color: var(--muted);
    font-weight: 800;
}

.account-form .money-field input {
    min-height: 2.75rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding-left: 0;
    box-shadow: none;
    outline: 0;
}

.money-field:focus-within {
    border-color: color-mix(in srgb, var(--gold) 68%, var(--line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 38%, transparent);
}

.account-form .money-field input:focus {
    border: 0;
    box-shadow: none;
    outline: 0;
}

.billing-settings input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.billing-settings input[type="number"]::-webkit-outer-spin-button,
.billing-settings input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.calendar-shell,
.teacher-week-shell {
    transition: opacity 140ms ease;
}

.calendar-shell.is-loading,
.teacher-week-shell.is-loading {
    opacity: 0.45;
}

.student-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
}

.student-detail-actions form {
    margin: 0;
}

.profile-summary-card {
    display: grid;
    align-content: start;
}

.profile-summary {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.profile-summary h2,
.profile-summary p {
    margin: 0;
}

.profile-summary h2 {
    font-size: clamp(1.45rem, 2vw, 2rem);
}

.profile-summary p {
    color: var(--muted);
}

.avatar-large {
    width: 5.25rem;
    height: 5.25rem;
    flex: 0 0 5.25rem;
}

.muted-note {
    margin-top: 1rem;
    color: var(--muted);
}

.bell-icon {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
}

.study-note-icon {
    display: inline-grid;
    width: 1.25rem;
    height: 1.25rem;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, #ffffff 18%, transparent);
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1;
}

.bell-icon {
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
}

.bell-icon::before,
.bell-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: currentColor;
}

.bell-icon::before {
    bottom: -0.22rem;
    width: 1.1rem;
    height: 0.14rem;
    border-radius: 999px;
}

.bell-icon::after {
    bottom: -0.46rem;
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 999px;
}

.reminder-button.is-off {
    color: var(--muted);
    opacity: 0.82;
}

.reminder-button.is-off .bell-icon::before {
    width: 1.2rem;
}

.reminder-button.is-off .bell-icon::after {
    content: "";
    top: 50%;
    bottom: auto;
    width: 1.36rem;
    height: 0.14rem;
    border-radius: 999px;
    transform: translate(-50%, -50%) rotate(-35deg);
}

.reminder-button.is-on {
    border-color: color-mix(in srgb, var(--green) 42%, var(--line));
    color: color-mix(in srgb, var(--green) 72%, var(--text));
}

.study-toggle-form.is-celebrating .study-toggle-button {
    animation: study-pop 340ms ease both;
}

@keyframes study-pop {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(244, 179, 33, 0);
    }
    45% {
        transform: scale(1.06);
        box-shadow: 0 0 0 0.65rem rgba(244, 179, 33, 0.16);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 1rem rgba(244, 179, 33, 0);
    }
}

.streak-panel {
    position: relative;
    overflow: hidden;
    gap: 0.85rem;
}

.streak-panel.is-goal-met {
    border-color: color-mix(in srgb, var(--green) 42%, var(--line));
    background:
        radial-gradient(circle at 7% 12%, color-mix(in srgb, var(--green) 13%, transparent), transparent 9rem),
        color-mix(in srgb, var(--surface-strong) 86%, var(--surface));
}

.streak-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.streak-actions form {
    margin: 0;
}

.streak-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: 8px;
    background:
        radial-gradient(circle at 2rem 2rem, rgba(244, 179, 33, 0.18), transparent 4rem),
        color-mix(in srgb, var(--surface-strong) 76%, transparent);
}

.streak-hero > div {
    min-width: 0;
}

.streak-hero.is-goal-met {
    border-color: color-mix(in srgb, var(--green) 58%, var(--gold));
    background:
        radial-gradient(circle at 2rem 2rem, color-mix(in srgb, var(--green) 22%, transparent), transparent 5.5rem),
        radial-gradient(circle at 92% 18%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 6rem),
        color-mix(in srgb, var(--green) 12%, var(--surface-strong));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 18%, transparent), 0 18px 52px rgba(0, 0, 0, 0.24);
}

.streak-hero.is-goal-met::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, var(--gold) 0 2px, transparent 2.5px),
        radial-gradient(circle, var(--green) 0 2px, transparent 2.5px),
        radial-gradient(circle, var(--rose) 0 1.6px, transparent 2.2px),
        radial-gradient(circle, var(--blue) 0 1.7px, transparent 2.3px);
    background-position: 12% 24%, 36% 8%, 72% 20%, 88% 42%;
    background-size: 5rem 5rem, 5.8rem 5.8rem, 4.6rem 4.6rem, 5.2rem 5.2rem;
    opacity: 0.58;
    animation: goal-confetti 1500ms ease-out both;
}

.streak-celebration {
    position: relative;
    z-index: 1;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.65rem;
    padding: 0.5rem 0.72rem;
    border: 1px solid color-mix(in srgb, var(--green) 52%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--green) 18%, var(--surface));
    color: color-mix(in srgb, var(--green) 76%, var(--text));
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 22%, transparent);
    animation: goal-badge-pop 600ms cubic-bezier(.2, 0, .2, 1) both;
}

.streak-celebration span {
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 999px;
    background: var(--green);
    color: var(--bg);
    font-weight: 900;
}

.streak-celebration strong {
    font-family: inherit;
    font-size: 0.98rem;
    line-height: 1.15;
}

.goal-confetti-side {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    pointer-events: none;
}

.goal-confetti-side span {
    position: absolute;
    top: 48%;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: var(--gold);
    opacity: 0;
    box-shadow: 0 0 0.65rem color-mix(in srgb, currentColor 42%, transparent);
}

.goal-confetti-side span:nth-child(odd) {
    left: 0.15rem;
    animation: side-confetti-left 980ms cubic-bezier(.2, 0, .2, 1) both;
}

.goal-confetti-side span:nth-child(even) {
    right: 0.15rem;
    animation: side-confetti-right 980ms cubic-bezier(.2, 0, .2, 1) both;
}

.goal-confetti-side span:nth-child(3n) {
    background: var(--green);
}

.goal-confetti-side span:nth-child(4n) {
    background: var(--rose);
}

.goal-confetti-side span:nth-child(5n) {
    background: var(--blue);
}

.goal-confetti-side span:nth-child(1) { top: 34%; animation-delay: 40ms; }
.goal-confetti-side span:nth-child(2) { top: 38%; animation-delay: 80ms; }
.goal-confetti-side span:nth-child(3) { top: 50%; animation-delay: 120ms; }
.goal-confetti-side span:nth-child(4) { top: 54%; animation-delay: 160ms; }
.goal-confetti-side span:nth-child(5) { top: 64%; animation-delay: 220ms; }
.goal-confetti-side span:nth-child(6) { top: 28%; animation-delay: 260ms; }
.goal-confetti-side span:nth-child(7) { top: 58%; animation-delay: 310ms; }
.goal-confetti-side span:nth-child(8) { top: 30%; animation-delay: 340ms; }
.goal-confetti-side span:nth-child(9) { top: 43%; animation-delay: 380ms; }
.goal-confetti-side span:nth-child(10) { top: 68%; animation-delay: 410ms; }
.goal-confetti-side span:nth-child(11) { top: 24%; animation-delay: 450ms; }
.goal-confetti-side span:nth-child(12) { top: 60%; animation-delay: 490ms; }

.streak-hero strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 3.6vw, 2.75rem);
    font-variant-numeric: lining-nums;
    line-height: 0.95;
}

.streak-hero span,
.streak-hero p {
    display: block;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.streak-hero p {
    max-width: 42rem;
    margin: 0.35rem 0 0;
}

.streak-hero .streak-celebration {
    max-width: 100%;
}

.streak-hero .streak-celebration span {
    display: inline-grid;
}

.streak-hero .streak-celebration strong {
    font-family: inherit;
    font-size: 0.98rem;
    line-height: 1.15;
}

.streak-note-badge {
    position: relative;
    display: grid;
    width: 3.75rem;
    height: 3.75rem;
    place-items: center;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), transparent 1.6rem),
        color-mix(in srgb, var(--gold) 18%, var(--surface));
    animation: note-badge-pulse 2200ms ease-in-out infinite;
}

.streak-note-badge::before,
.streak-note-badge::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 32%, transparent);
    opacity: 0;
}

.streak-note-badge::before {
    width: 0.32rem;
    height: 0.32rem;
    left: 0.62rem;
    top: 0.8rem;
    animation: note-spark 2200ms ease-in-out infinite;
}

.streak-note-badge::after {
    width: 0.24rem;
    height: 0.24rem;
    right: 0.72rem;
    bottom: 0.78rem;
    animation: note-spark 2200ms 520ms ease-in-out infinite;
}

.streak-note-shape {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: 999px;
    color: var(--gold-strong);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1;
    transform-origin: 50% 75%;
    animation: note-sway 1600ms ease-in-out infinite;
}

.streak-hero.is-hot .streak-note-shape {
    color: var(--gold-strong);
}

.streak-hero.is-hot .streak-note-badge {
    border: 1px solid color-mix(in srgb, var(--green) 44%, var(--line));
    background: color-mix(in srgb, var(--green) 24%, var(--surface));
}

@keyframes note-sway {
    0%,
    100% {
        transform: rotate(-2deg) translateY(0);
    }
    50% {
        transform: rotate(4deg) translateY(-0.08rem);
    }
}

@keyframes note-badge-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(244, 179, 33, 0);
    }
    50% {
        box-shadow: 0 0 0 0.45rem rgba(244, 179, 33, 0.08);
    }
}

@keyframes note-spark {
    0%,
    100% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }
    45% {
        opacity: 1;
        transform: translateY(-0.18rem) scale(1);
    }
}

.day-pill {
    position: relative;
}

.day-pill .day-icon {
    display: grid;
    min-width: 1.6rem;
    height: 1.6rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding-inline: 0.42rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.day-pill.is-studied .day-icon {
    border-color: color-mix(in srgb, var(--green) 70%, var(--line));
    background: var(--green);
    color: #06110f;
}

.day-pill.is-today:not(.is-studied) .day-icon {
    border-color: color-mix(in srgb, var(--gold) 52%, var(--line));
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold);
}

.streak-off-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.streak-off-panel p {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 72;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(14px);
    animation: modal-fade-in 180ms ease both;
}

.welcome-modal.is-leaving {
    pointer-events: none;
    animation: welcome-fade-out 220ms ease both;
}

.welcome-modal-glow {
    position: absolute;
    width: min(34rem, 78vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--gold) 36%, transparent), transparent, color-mix(in srgb, var(--green) 24%, transparent), transparent);
    filter: blur(20px);
    opacity: 0.68;
    animation: welcome-glow-spin 4.8s linear both;
}

.welcome-card {
    position: relative;
    width: min(34rem, 100%);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 14%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 9rem),
        linear-gradient(150deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
    animation: welcome-card-pop 360ms cubic-bezier(.2, 0, .2, 1) both;
}

.welcome-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.78rem;
    justify-items: center;
    padding: 2rem 1.45rem 1.45rem;
    text-align: center;
}

.welcome-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-grid;
    width: 2.1rem;
    height: 2.1rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.welcome-close:hover {
    border-color: color-mix(in srgb, var(--gold) 48%, var(--line));
    color: var(--gold);
}

.welcome-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.welcome-confetti span,
.welcome-confetti i {
    position: absolute;
    top: -1rem;
    left: var(--x, 50%);
    color: var(--c, var(--gold));
    opacity: 0;
    animation: welcome-confetti-fall var(--d, 2.6s) cubic-bezier(.2, 0, .2, 1) var(--delay, 0s) both;
}

.welcome-confetti span {
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--s, 1rem);
    font-weight: 900;
}

.welcome-confetti i {
    width: var(--s, 0.46rem);
    height: var(--s, 0.46rem);
    border-radius: 0.14rem;
    background: var(--c, var(--gold));
}

.welcome-confetti span:nth-child(1) { --x: 10%; --c: var(--gold); --s: 1.1rem; --delay: .05s; }
.welcome-confetti i:nth-child(2) { --x: 20%; --c: var(--green); --delay: .2s; }
.welcome-confetti span:nth-child(3) { --x: 31%; --c: #7cb7ff; --s: 1.25rem; --delay: .12s; }
.welcome-confetti i:nth-child(4) { --x: 42%; --c: #ff7aa9; --delay: .34s; }
.welcome-confetti span:nth-child(5) { --x: 51%; --c: var(--gold); --s: 1.05rem; --delay: .26s; }
.welcome-confetti i:nth-child(6) { --x: 62%; --c: var(--green); --delay: .08s; }
.welcome-confetti span:nth-child(7) { --x: 72%; --c: #ff7aa9; --s: 1.22rem; --delay: .22s; }
.welcome-confetti i:nth-child(8) { --x: 82%; --c: #7cb7ff; --delay: .4s; }
.welcome-confetti span:nth-child(9) { --x: 88%; --c: var(--gold); --s: 1rem; --delay: .14s; }
.welcome-confetti i:nth-child(10) { --x: 15%; --c: #ff7aa9; --delay: .58s; }
.welcome-confetti span:nth-child(11) { --x: 67%; --c: var(--green); --s: 1.16rem; --delay: .52s; }
.welcome-confetti i:nth-child(12) { --x: 93%; --c: var(--gold); --delay: .68s; }

.welcome-symbol-wrap {
    position: relative;
    display: grid;
    width: 7rem;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--gold) 16%, transparent), transparent 68%),
        color-mix(in srgb, var(--surface) 62%, transparent);
}

.welcome-symbol-wrap::before {
    content: "";
    position: absolute;
    inset: -0.4rem;
    border-radius: inherit;
    border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
    animation: welcome-symbol-pulse 1.8s ease-in-out 3;
}

.welcome-symbol-wrap::after {
    content: "";
    position: absolute;
    top: 1.25rem;
    right: 1.2rem;
    width: 0.72rem;
    height: 0.72rem;
    clip-path: polygon(50% 0, 64% 35%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 35%);
    background: #fff3bc;
    box-shadow: 0 0 18px color-mix(in srgb, var(--gold) 70%, transparent);
    animation: welcome-sparkle 1.5s ease-in-out 3;
}

.welcome-symbol {
    width: 5.2rem;
    height: 5.2rem;
    object-fit: contain;
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--gold) 36%, transparent));
}

.welcome-card h2,
.welcome-card p {
    margin: 0;
}

.welcome-card h2 {
    font-size: clamp(2rem, 8vw, 3.15rem);
}

.welcome-card p {
    max-width: 27rem;
    color: var(--muted);
    font-size: 1rem;
}

.welcome-card .welcome-small {
    color: color-mix(in srgb, var(--text) 82%, var(--muted));
    font-weight: 700;
}

.welcome-action {
    margin-top: 0.2rem;
}

.streak-goal-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(12px);
    animation: modal-fade-in 180ms ease both;
}

.streak-goal-card {
    position: relative;
    display: grid;
    gap: 0.85rem;
    width: min(34rem, 100%);
    padding: 1.35rem;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: 16px;
    background:
        radial-gradient(circle at 18% 10%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 10rem),
        var(--surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    animation: streak-card-pop 240ms cubic-bezier(.2, 0, .2, 1) both;
}

.streak-goal-card h2,
.streak-goal-card p {
    margin: 0;
}

.streak-goal-card p {
    color: var(--muted);
}

.streak-goal-hint {
    font-size: 0.94rem;
}

.streak-goal-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.streak-goal-close:hover {
    border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
    color: var(--gold);
}

.streak-review {
    display: grid;
    gap: 0.45rem;
    padding: 0.8rem;
    border: 1px solid color-mix(in srgb, var(--green) 32%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--green) 8%, transparent);
}

.streak-review-top {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    justify-content: space-between;
}

.streak-review-top span {
    color: var(--green);
    font-weight: 900;
}

.streak-review-bar {
    height: 0.7rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--green) 34%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.streak-review-bar span {
    display: block;
    width: var(--review-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--green));
    box-shadow: 0 0 18px color-mix(in srgb, var(--green) 32%, transparent);
    animation: streak-review-fill 920ms cubic-bezier(.2, 0, .2, 1) both;
}

.streak-review-markers {
    display: flex;
    gap: 0.45rem;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.streak-goal-form,
.streak-goal-card form {
    margin: 0;
}

.streak-goal-options {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

.streak-goal-options button {
    display: grid;
    min-height: 4rem;
    place-items: center;
    gap: 0.08rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.streak-goal-options button:hover,
.streak-goal-options button.is-current,
.streak-goal-options button.is-selected {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--gold) 52%, var(--line));
    background: color-mix(in srgb, var(--gold) 15%, var(--surface));
}

.streak-goal-options strong {
    color: var(--gold-strong);
    font-size: 1.35rem;
}

.streak-goal-options span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.daily-tip-card {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 18;
    display: grid;
    gap: 0.32rem;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.9rem 2.3rem 0.95rem 0.95rem;
    border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
    border-radius: 14px;
    background:
        radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 7rem),
        color-mix(in srgb, var(--surface-strong) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    animation: daily-tip-in 300ms ease both;
    touch-action: pan-y;
}

.daily-tip-card button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.daily-tip-card button:hover {
    border-color: var(--line);
    color: var(--gold);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.daily-tip-card strong {
    color: var(--text);
}

.daily-tip-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.daily-tip-card.is-hiding {
    animation: daily-tip-out 170ms ease both;
}

.daily-tip-card.is-swiping {
    transition: none;
}

.status-paid {
    border-color: color-mix(in srgb, var(--green) 54%, var(--line)) !important;
    background: color-mix(in srgb, var(--green) 15%, var(--surface)) !important;
}

.student-status-panel.status-paid {
    border-color: var(--line) !important;
    background: var(--surface) !important;
}

.student-status-panel.status-late,
.student-status-panel.status-reported {
    background: var(--surface) !important;
}

.student-status-panel .simple-stats > div:not(.status-paid-text):not(.status-late-text) strong {
    color: var(--text);
}

.status-paid strong {
    color: #58e89b;
}

.status-paid-row {
    padding: 0.85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--green) 48%, var(--line)) !important;
    border-radius: var(--radius-sm);
    border-color: color-mix(in srgb, var(--green) 48%, var(--line)) !important;
    background: color-mix(in srgb, var(--green) 12%, var(--surface)) !important;
}

.status-paid-row strong,
.status-paid-text strong {
    color: #58e89b;
}

.status-late-text strong {
    color: #ff8a8a;
}

.title-link {
    color: inherit;
    text-decoration: none;
}

.title-link:hover {
    color: var(--gold);
}

.calendar-day[data-day-trigger] {
    cursor: pointer;
}

.calendar-day[data-day-trigger]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

.day-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.64);
    animation: fade-in 140ms ease;
}

.day-popover {
    position: absolute;
    z-index: 80;
    width: min(24rem, calc(100vw - 1.5rem));
    max-height: min(28rem, calc(100vh - 1.5rem));
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
    animation: popover-in 120ms ease;
}

.day-modal {
    position: relative;
    width: min(26rem, 100%);
    max-height: min(34rem, calc(100vh - 2rem));
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.day-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 1.2rem;
}

.day-modal-body {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 2.8rem 1rem 1rem;
}

.day-detail-heading h2 {
    margin: 0.2rem 0 0;
    font-size: 1.45rem;
    text-transform: none;
}

.day-detail-note,
.day-detail-empty {
    margin: 0;
    color: var(--muted);
}

.day-detail-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.day-detail-list li {
    display: grid;
    gap: 0.12rem;
    padding: 0.7rem;
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    background: var(--bg-soft);
}

.day-detail-list li.event {
    border-left-color: var(--teal);
}

.day-detail-list li.fee {
    border-left-color: var(--green);
}

.day-detail-list span {
    color: var(--muted);
    font-size: 0.92rem;
}

.week-mode-toggle,
.sync-preferences {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.week-mode-toggle {
    justify-self: end;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
}

.week-mode-toggle button {
    min-height: 2rem;
    border: 0;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.week-mode-toggle button:hover,
.week-mode-toggle button.is-active {
    background: var(--gold);
    color: var(--on-gold);
}

.teacher-week {
    max-height: 34rem;
    overflow-y: auto;
    padding-right: 0.2rem;
    overscroll-behavior: contain;
}

.teacher-week-shell.is-compact .week-item {
    gap: 0;
    padding-block: 0.45rem;
}

.teacher-week-shell.is-compact .week-item span {
    display: none;
}

.teacher-week-shell.is-compact .teacher-week-day {
    min-height: 7.2rem;
}

.sync-preferences {
    padding-top: 0.35rem;
}

.sync-preferences label {
    color: var(--muted);
    font-weight: 800;
}

.sync-preferences select {
    min-height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--bg);
    color: var(--text);
    padding: 0.35rem 2.45rem 0.35rem 0.6rem;
    font: inherit;
}

.google-warning {
    align-items: center;
    justify-content: space-between;
}

.google-warning span {
    flex: 1 1 auto;
}

.student-subnav-section {
    gap: 0.85rem;
}

.student-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 74%, transparent);
}

.student-subnav button {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 2.45rem;
    border: 0;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.student-subnav .tab-icon {
    color: var(--gold);
    opacity: 0.9;
}

.student-subnav button:hover .tab-icon,
.student-subnav button.is-active .tab-icon {
    opacity: 1;
}

.student-subnav button:hover,
.student-subnav button.is-active {
    background: color-mix(in srgb, var(--gold) 18%, var(--surface));
    color: var(--text);
}

.student-tab-panel {
    display: none;
}

.student-tab-panel.is-active {
    display: block;
}

.student-detail-stack {
    display: grid;
    gap: 1.25rem;
}

.student-detail-stack > .panel {
    width: 100%;
}

.student-edit-form .student-status-grid {
    align-items: start;
}

.student-edit-form .student-status-grid .field-stack {
    align-self: start;
}

.student-edit-form .student-status-grid select {
    box-sizing: border-box;
    height: 3rem;
    min-height: 3rem;
    padding-block: 0;
    line-height: 1.2;
}

.subsection-block {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.compact-more-details {
    margin-top: 0.75rem;
}

.calendar-overview-grid .action-list li {
    min-height: auto;
    padding-block: 0.7rem;
}

.calendar-overview-grid .action-list li > strong {
    font-size: 0.98rem;
}

.calendar-overview-grid .action-list li > span {
    font-size: 0.86rem;
}

.billing-settings {
    grid-template-columns: repeat(3, minmax(7.5rem, 12rem));
    align-items: end;
}

.billing-settings .field-stack:has(textarea),
.billing-settings .button {
    grid-column: 1 / -1;
}

.billing-settings .money-field {
    max-width: 12rem;
}

@media (max-width: 720px) {
    .billing-settings {
        grid-template-columns: 1fr;
    }

    .billing-settings .money-field {
        max-width: 100%;
    }
}

.weekly-plan-panel {
    gap: 0.75rem;
}

.weekly-plan-form {
    display: grid;
    gap: 0.7rem;
}

.form-section-block {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.form-section-block.is-student-specific {
    border-color: color-mix(in srgb, var(--green) 26%, var(--line));
    background: color-mix(in srgb, var(--green) 5%, transparent);
}

.form-section-block .muted-note {
    margin: 0;
}

.study-item-mode-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: 1fr;
    align-items: start;
    max-width: 920px;
}

.study-item-create-shell {
    margin-top: 0.9rem;
    border-radius: 14px;
}

.study-item-create-shell > summary {
    border-color: color-mix(in srgb, var(--gold) 64%, var(--line));
    background: color-mix(in srgb, var(--gold) 10%, var(--surface-strong));
}

.study-item-create-shell[open] {
    border-color: color-mix(in srgb, var(--gold) 30%, var(--line));
    background: color-mix(in srgb, var(--bg-soft) 82%, var(--surface));
}

.study-item-create-panel {
    display: grid;
    gap: 0.6rem;
    padding: 0.6rem;
    max-width: 920px;
    border-radius: 12px;
}

.study-item-mode {
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 12px;
    border-color: color-mix(in srgb, var(--gold) 22%, var(--line));
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.study-item-mode > summary {
    width: 100%;
    min-height: 2.25rem;
    justify-content: space-between;
    margin: 0 !important;
    border: 0;
    border-radius: 0;
    padding: 0.45rem 0.65rem;
    background: color-mix(in srgb, var(--surface-strong) 42%, transparent);
    font-size: 0.95rem;
}

.study-item-mode[open] > summary {
    border-bottom: 1px solid color-mix(in srgb, var(--gold) 18%, var(--line));
}

.study-item-create-form {
    gap: 0.55rem;
    padding: 0.65rem;
}

.study-item-create-form .form-section-block {
    gap: 0.35rem;
    padding: 0.6rem;
}

.study-item-create-form .field-stack {
    gap: 0.25rem;
}

.study-item-create-form input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]),
.study-item-create-form select,
.study-item-create-form textarea,
.study-item-create-form .material-picker input,
.study-item-create-form .material-picker button,
.study-item-create-form .topic-card input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]),
.study-item-create-form .topic-card select,
.study-item-create-form .topic-card textarea {
    min-height: 2.35rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
}

.study-item-create-form textarea {
    min-height: 4.25rem;
}

.study-item-create-form .topic-card textarea {
    min-height: 2.35rem;
}

.study-item-create-form .button {
    min-height: 2.35rem;
    padding-block: 0.5rem;
}

.study-item-edit-panel {
    max-width: 920px;
    border-radius: 14px;
}

.study-item-edit-form {
    gap: 0.55rem;
}

.study-item-edit-form .field-stack {
    gap: 0.25rem;
}

.study-item-edit-form input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]),
.study-item-edit-form select,
.study-item-edit-form textarea {
    min-height: 2.35rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
}

.study-item-edit-form textarea {
    min-height: 4rem;
}

.material-reference-card {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.72rem;
    margin: 0.45rem 0 0.6rem;
    border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--gold) 6%, var(--surface));
}

.material-reference-card h2 {
    margin: 0.08rem 0 0.15rem;
    font-size: 1.05rem;
}

.material-reference-card p,
.material-reference-card small {
    margin: 0;
}

.material-reference-actions,
.compact-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.compact-actions {
    margin-top: 0.2rem;
}

.danger-outline-button {
    border-color: color-mix(in srgb, #ff7a7a 52%, var(--line));
    color: #ffb6b6;
}

.danger-outline-button:hover {
    border-color: #ff8c8c;
    background: color-mix(in srgb, #ff5d5d 12%, transparent);
    color: #ffe1e1;
}

.compact-suggest-field {
    gap: 0.5rem;
}

@media (max-width: 720px) {
    .study-item-mode-grid {
        grid-template-columns: 1fr;
    }

    .material-reference-card {
        display: grid;
    }
}

.material-picker {
    position: relative;
    display: grid;
    gap: 0.55rem;
}

.material-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
}

.material-suggestions {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 12;
    display: grid;
    width: min(34rem, 100%);
    max-height: 18rem;
    overflow: auto;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.material-suggestions[hidden] {
    display: none;
}

.material-suggestions button,
.material-suggestions a {
    display: grid;
    gap: 0.1rem;
    min-height: auto;
    padding: 0.7rem 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.material-suggestions button:hover,
.material-suggestions a:hover {
    background: color-mix(in srgb, var(--gold) 12%, transparent);
}

.material-suggestions button span,
.material-suggestions a span {
    color: var(--muted);
    font-size: 0.85rem;
}

.inline-suggestions {
    top: calc(100% + 0.35rem);
}

.material-title-checker {
    position: relative;
}

.material-lock-note {
    margin: 0;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 800;
}

.is-locked {
    background:
        repeating-linear-gradient(-45deg, transparent 0 0.55rem, rgba(255, 255, 255, 0.018) 0.55rem 1.1rem),
        color-mix(in srgb, var(--surface) 74%, var(--bg)) !important;
    color: var(--muted) !important;
    cursor: not-allowed;
}

.weekly-select-list {
    display: grid;
    gap: 0.9rem;
}

.weekly-select-item {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 28%, transparent);
}

.weekly-select-item.is-selected {
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.weekly-select-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.weekly-select-card strong,
.weekly-select-card small {
    display: block;
}

.weekly-select-card small {
    margin-top: 0.18rem;
    color: var(--muted);
}

.weekly-select-item textarea {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
}

.weekly-study-item textarea {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
}

.weekly-study-item label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.inline-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.suggest-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
    gap: 0.75rem;
    align-items: end;
}

.suggest-select {
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--bg);
    color: var(--text);
    padding-inline: 0.75rem;
    font: inherit;
}

.student-list {
    display: grid;
    gap: 0.85rem;
    width: 100%;
}

.student-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 5.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.student-row > * {
    min-width: 0;
}

.student-row:hover,
.student-row:focus-visible {
    border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
    background: color-mix(in srgb, var(--gold) 5%, var(--surface));
    transform: translateY(-1px);
}

.student-row strong,
.student-row span,
.student-row small {
    display: block;
}

.student-row strong {
    margin-bottom: 0.18rem;
}

.student-row span,
.student-row small {
    color: var(--muted);
}

.student-row small {
    margin-top: 0.28rem;
}

.signup-request-row .row-actions {
    flex: 0 0 auto;
}

.signup-request-row .row-actions form {
    margin: 0;
}

.check-row {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    color: var(--text);
    font-weight: 800;
}

.check-row input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--gold);
}

.student-study-tabs {
    scroll-margin-top: 6rem;
    gap: 0.75rem;
}

.student-study-tabs .student-tab-panel {
    padding-top: 0.15rem;
}

.student-page .student-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.7fr);
    gap: 1.25rem;
}

.student-page .streak-panel,
.student-page .streak-off-panel {
    grid-column: 1 / -1;
    order: 1;
}

.student-page .student-study-tabs {
    grid-column: 1 / -1;
    order: 2;
    min-height: 0;
}

.student-page .student-calendar-card {
    grid-column: 1;
    order: 3;
    width: 100%;
    justify-self: stretch;
}

.student-page .student-calendar-card .panel-heading {
    justify-content: flex-start;
    text-align: left;
}

.student-page .student-calendar-card .calendar-weekdays,
.student-page .student-calendar-card .calendar-grid {
    width: 100%;
}

.student-side-stack {
    grid-column: 2;
    order: 4;
    display: grid;
    gap: 1.25rem;
    align-self: start;
}

.student-quick-panel {
    --quick-accent: var(--gold);
    min-height: 10rem;
    align-content: start;
    border-left-color: color-mix(in srgb, var(--quick-accent) 44%, var(--line));
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.student-quick-panel.card-link {
    color: inherit;
    text-decoration: none;
}

.student-quick-panel.card-link *,
.tool-coming-card,
.tool-coming-card * {
    text-decoration: none;
}

.student-quick-panel.card-link strong {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
}

.student-quick-panel .fee-report-form {
    margin-top: 0.25rem;
}

.student-quick-panel:nth-child(1) {
    --quick-accent: var(--teal);
}

.student-quick-panel:nth-child(2) {
    --quick-accent: var(--green);
}

.student-quick-panel:nth-child(3) {
    --quick-accent: var(--gold);
}

.student-quick-panel:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--quick-accent) 38%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 82%, var(--surface));
}

.metronome-icon::before,
.metronome-icon::after {
    content: "";
    position: absolute;
}

.metronome-icon::before {
    left: 0.2rem;
    top: 0.1rem;
    width: 0.48rem;
    height: 0.72rem;
    border: 1.7px solid currentColor;
    border-radius: 999px 999px 0.18rem 0.18rem;
}

.metronome-icon::after {
    left: 0.1rem;
    bottom: 0.05rem;
    width: 0.74rem;
    height: 1.7px;
    border-radius: 99px;
    background: currentColor;
    box-shadow: 0.26rem -0.26rem 0 -0.04rem currentColor;
}

.metronome-icon {
    color: var(--green);
}

.tools-icon {
    color: var(--teal);
}

.tools-icon::before,
.tools-icon::after,
.keyboard-tool-icon::before,
.keyboard-tool-icon::after,
.tuner-tool-icon::before,
.tuner-tool-icon::after {
    content: "";
    position: absolute;
}

.tools-icon::before {
    left: 0.18rem;
    top: 0.48rem;
    width: 0.72rem;
    height: 0.18rem;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(-45deg);
    transform-origin: center;
}

.tools-icon::after {
    left: 0.12rem;
    top: 0.08rem;
    width: 0.44rem;
    height: 0.44rem;
    border: 1.7px solid currentColor;
    border-right-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
    transform: rotate(-45deg);
}

.keyboard-tool-icon {
    color: var(--blue);
}

.keyboard-tool-icon::before {
    inset: 0.15rem 0.06rem;
    border: 1.7px solid currentColor;
    border-radius: 3px;
}

.keyboard-tool-icon::after {
    left: 0.28rem;
    top: 0.17rem;
    width: 1.7px;
    height: 0.58rem;
    background: currentColor;
    box-shadow: 0.2rem 0 0 currentColor, 0.4rem 0 0 currentColor;
}

.tuner-tool-icon {
    color: var(--rose);
}

.tuner-tool-icon::before {
    left: 0.42rem;
    top: 0.1rem;
    width: 0.12rem;
    height: 0.78rem;
    border-radius: 99px;
    background: currentColor;
}

.tuner-tool-icon::after {
    left: 0.25rem;
    top: 0.08rem;
    width: 0.48rem;
    height: 0.48rem;
    border: 1.7px solid currentColor;
    border-bottom-color: transparent;
    border-radius: 50%;
}

.metronome-section {
    padding-bottom: 3rem;
}

.metronome-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
    gap: 1.25rem;
    align-items: start;
}

.metronome-main-panel,
.metronome-settings-panel {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
}

.metronome-main-panel {
    gap: 0.72rem;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--gold) 18%, var(--line));
    box-shadow: 0 1.2rem 3rem color-mix(in srgb, #000 12%, transparent);
}

.metronome-heading {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr);
    gap: 0.9rem;
    align-items: center;
}

.metronome-andamento-core {
    display: grid;
    justify-items: center;
    text-align: center;
}

.metronome-heading h2 {
    font-size: clamp(2.4rem, 7vw, 4.4rem);
    line-height: 0.95;
}

.metronome-bpm-strip {
    display: grid;
    grid-template-columns: auto minmax(0, auto) auto;
    gap: 0.55rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.12rem;
}

.metronome-bpm-readout {
    display: grid;
    justify-items: center;
    min-width: 8.8rem;
}

.metronome-bpm-title {
    display: block;
    text-align: center;
}

.metronome-bpm-title input {
    display: block;
    width: 3.2ch;
    min-width: 0;
    margin-inline: auto;
    border: 0;
    border-bottom: 2px solid color-mix(in srgb, var(--gold) 72%, transparent);
    border-radius: 0;
    padding: 0 0.08em 0.04em;
    background: transparent;
    color: var(--text);
    font: inherit;
    line-height: 0.95;
    text-align: center;
    outline: 0;
    box-shadow: none;
}

.metronome-bpm-title input:focus {
    border-color: var(--green);
    color: var(--gold-strong);
}

.metronome-bpm-title input::-webkit-outer-spin-button,
.metronome-bpm-title input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.metronome-bpm-unit {
    display: block;
    margin-top: 0.12rem;
    color: var(--gold);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.metronome-heading p {
    margin-top: 0.08rem;
    font-weight: 800;
}

.metronome-step-pair {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.28rem;
    align-items: center;
}

.metronome-step-pair.is-negative {
    justify-content: end;
}

.metronome-step-pair.is-positive {
    justify-content: start;
}

.metronome-click-unit {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.4rem;
    align-items: center;
    margin-top: 0.28rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.metronome-click-unit-top {
    align-self: center;
    justify-self: start;
    margin-top: 1.25rem;
}

.metronome-click-unit .rhythm-figure {
    width: 1.24rem;
    height: 1.72rem;
    flex: 0 0 1.24rem;
    color: var(--gold);
}

.metronome-click-unit .rhythm-figure-smufl {
    font-size: 1.72rem;
}

.metronome-click-unit small {
    color: var(--green);
    font-size: 0.68rem;
}

.metronome-view-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.36rem;
    justify-self: center;
    width: min(100%, 46rem);
    max-width: none;
    margin-bottom: 0.15rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}

.metronome-view-tabs::after {
    content: none;
}

.metronome-view-tabs button {
    display: grid;
    grid-template-rows: 1.55rem auto;
    gap: 0.14rem;
    min-width: 0;
    min-height: 3.05rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
    border-radius: 7px;
    padding: 0.36rem 0.28rem 0.3rem;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 76%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    line-height: 1.05;
    cursor: pointer;
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.metronome-view-tabs button:hover,
.metronome-view-tabs button.is-active {
    border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--gold) 14%, var(--surface-strong)), color-mix(in srgb, var(--surface) 90%, transparent));
    color: var(--gold-strong);
}

.metronome-view-tabs button:hover {
    transform: translateY(-1px);
}

.metronome-view-tabs button.is-active {
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent),
        0 0 0 0.12rem color-mix(in srgb, var(--gold) 12%, transparent);
}

.metronome-view-icon {
    position: relative;
    display: block;
    width: 2rem;
    height: 1.5rem;
    color: currentColor;
}

.metronome-view-label {
    max-width: 100%;
    overflow: visible;
    color: currentColor;
    font-size: 0.58rem;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.18;
    text-overflow: clip;
    text-transform: none;
    white-space: nowrap;
}

.view-icon-figures {
    display: grid;
    place-items: center;
    color: var(--gold);
}

.view-icon-figures .rhythm-figure {
    width: 1.7rem;
    height: 1.5rem;
    font-size: 1.6rem;
}

.view-icon-figures .rhythm-glyph {
    transform: translateY(0.08em);
}

.view-icon-figures svg {
    display: block;
    overflow: visible;
}

.view-icon-mechanical::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.08rem;
    width: 1.42rem;
    height: 1.28rem;
    border-radius: 0.14rem 0.14rem 0.26rem 0.26rem;
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--gold) 54%, transparent), color-mix(in srgb, var(--green) 28%, transparent));
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: translateX(-50%);
}

.view-icon-mechanical::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.1rem;
    width: 2px;
    height: 1.2rem;
    border-radius: 99px;
    background: color-mix(in srgb, var(--text) 86%, transparent);
    transform: translateX(-50%) rotate(-19deg);
    transform-origin: 50% 100%;
}

.view-icon-mechanical i {
    position: absolute;
    left: 50%;
    bottom: 0.08rem;
    width: 1.72rem;
    height: 0.12rem;
    border-radius: 999px;
    background: var(--gold);
    transform: translateX(-50%);
}

.view-icon-mechanical b {
    position: absolute;
    left: calc(50% - 0.18rem);
    top: 0.48rem;
    width: 0.36rem;
    height: 0.36rem;
    border-radius: 999px;
    background: var(--green);
}

.view-icon-dots {
    display: inline-flex;
    gap: 0.14rem;
    align-items: center;
    justify-content: center;
}

.view-icon-dots i {
    width: 0.36rem;
    height: 0.36rem;
    border: 1.5px solid color-mix(in srgb, var(--muted) 72%, transparent);
    border-radius: 999px;
}

.view-icon-dots i:first-child {
    width: 0.48rem;
    height: 0.48rem;
    border-color: var(--gold);
    background: var(--gold);
    box-shadow: 0 0 0.45rem color-mix(in srgb, var(--gold) 36%, transparent);
}

.view-icon-dots i:nth-child(2) {
    border-color: var(--green);
    background: var(--green);
}

.view-icon-numbers {
    color: var(--gold);
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.45rem;
    text-align: center;
}

.view-icon-pulse {
    display: grid;
    place-items: center;
}

.view-icon-pulse::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.18rem;
    height: 1.18rem;
    border: 2px solid color-mix(in srgb, var(--green) 82%, var(--gold));
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow:
        inset 0 0 0 0.18rem color-mix(in srgb, var(--gold) 13%, transparent),
        0 0 0.65rem color-mix(in srgb, var(--green) 28%, transparent);
    transform: translate(-50%, -50%);
}

.view-icon-pulse i,
.view-icon-pulse b {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 0.5rem;
    height: 2px;
    border-radius: 99px;
    transform: translateY(-50%);
}

.view-icon-pulse i {
    left: 0.12rem;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.view-icon-pulse b {
    right: 0.12rem;
    background: linear-gradient(90deg, var(--green), transparent);
}

.view-icon-pulse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0.42rem color-mix(in srgb, var(--gold) 50%, transparent);
    transform: translate(-50%, -50%);
}

.view-icon-pulse i::before,
.view-icon-pulse b::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 0.16rem;
    height: 0.16rem;
    border-radius: 999px;
    background: currentColor;
    transform: translateY(-50%);
}

.view-icon-pulse i::before {
    right: -0.02rem;
    color: var(--gold);
}

.view-icon-pulse b::before {
    left: -0.02rem;
    color: var(--green);
}

.metronome-play-button {
    min-width: 8.8rem;
    margin-top: 1.25rem;
    justify-self: end;
}

.metronome-play-button[aria-pressed="true"] {
    background: var(--green);
    color: #06110f;
}

.play-mark {
    position: relative;
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 0.9rem;
}

.play-mark::before {
    content: "";
    position: absolute;
    inset: 0.08rem 0.12rem;
    clip-path: polygon(18% 0, 100% 50%, 18% 100%);
    background: currentColor;
}

.metronome-play-button[aria-pressed="true"] .play-mark::before {
    inset: 0.08rem 0.17rem;
    clip-path: none;
    background: linear-gradient(90deg, currentColor 0 32%, transparent 32% 68%, currentColor 68% 100%);
}

.metronome-stage {
    position: relative;
    display: grid;
    min-height: 17.8rem;
    place-items: center;
    overflow: visible;
    border: 0;
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--gold) 7%, transparent), transparent 42%),
        radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--green) 10%, transparent), transparent 8.5rem),
        linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 42%, transparent), color-mix(in srgb, var(--surface) 60%, transparent));
}

.metronome-stage::before {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.65rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 80%, transparent), color-mix(in srgb, var(--green) 64%, transparent), transparent);
}

.metronome-gradient-line {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--green) 72%, transparent), color-mix(in srgb, var(--blue) 55%, transparent), transparent);
    opacity: 0.85;
}

.metronome-visual {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.metronome-visual[hidden] {
    display: none;
}

.metronome-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(13rem, 62vw);
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.metronome-orbit::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--pulse-ring, conic-gradient(var(--gold) 0 86deg, transparent 86deg 90deg, color-mix(in srgb, var(--muted) 35%, transparent) 90deg 176deg, transparent 176deg 180deg, color-mix(in srgb, var(--muted) 35%, transparent) 180deg 266deg, transparent 266deg 270deg, color-mix(in srgb, var(--muted) 35%, transparent) 270deg 356deg, transparent 356deg 360deg));
    opacity: 0.96;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}

.metronome-orbit span {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 1;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0.9rem color-mix(in srgb, var(--gold) 45%, transparent);
    transform: translate(-50%, -50%);
}

.metronome-orbit.is-ticking {
    animation: metronome-ring 170ms ease-out both;
}

.metronome-orbit.is-accent {
    filter: drop-shadow(0 0 0.75rem color-mix(in srgb, var(--green) 22%, transparent));
}

.metronome-orbit.is-accent span {
    background: var(--green);
    box-shadow: 0 0 1.1rem color-mix(in srgb, var(--green) 50%, transparent);
}

.metronome-count {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.3rem;
    align-items: center;
    color: var(--text);
    transform: translateY(-0.18rem);
}

.metronome-count strong {
    font-size: clamp(5.2rem, 18vw, 8.8rem);
    line-height: 0.9;
}

.metronome-count span {
    color: var(--muted);
    font-size: 2rem;
    font-weight: 800;
}

.metronome-meter-label {
    position: absolute;
    right: 1rem;
    bottom: 1.45rem;
    z-index: 1;
    border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--line));
    border-radius: 8px;
    padding: 0.3rem 0.55rem;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    color: var(--gold-strong);
    min-width: 2.5rem;
}

.time-signature {
    display: inline-grid;
    min-width: 1.28em;
    grid-template-rows: repeat(2, 0.72em);
    align-items: center;
    justify-items: center;
    color: currentColor;
    font-family: "Bravura", serif;
    font-size: 1.58rem;
    font-style: normal;
    font-weight: 400;
    line-height: 0.72;
    text-rendering: geometricPrecision;
}

.time-signature-row {
    display: block;
    min-width: 100%;
    text-align: center;
    white-space: nowrap;
}

.metronome-meter-label .time-signature {
    font-size: 1.72rem;
}

.mechanical-metronome {
    position: relative;
    width: min(13.5rem, 72vw);
    height: 14rem;
}

.mechanical-body {
    position: absolute;
    left: 50%;
    bottom: 0.2rem;
    width: 10.5rem;
    height: 12.2rem;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 8px 8px 1.4rem 1.4rem;
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--gold) 18%, transparent), transparent 38%),
        linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), color-mix(in srgb, var(--bg-soft) 82%, transparent));
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: translateX(-50%);
    box-shadow: inset 0 -1.6rem 2.8rem color-mix(in srgb, #000 22%, transparent);
}

.mechanical-window {
    position: absolute;
    left: 50%;
    bottom: 2rem;
    width: 3.4rem;
    height: 1.1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--green));
    opacity: 0.75;
    transform: translateX(-50%);
}

.mechanical-arm {
    position: absolute;
    left: 50%;
    bottom: 2.2rem;
    z-index: 2;
    width: 0.18rem;
    height: 10.8rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 92%, #fff);
    transform: translateX(-50%) rotate(0deg);
    transform-origin: 50% 88%;
    box-shadow: 0 0 1rem color-mix(in srgb, var(--gold) 28%, transparent);
    transition: transform 260ms ease-out;
}

.mechanical-arm i {
    position: absolute;
    left: 50%;
    top: 2.6rem;
    display: block;
    width: 1.35rem;
    height: 0.58rem;
    border-radius: 999px;
    background: var(--green);
    transform: translateX(-50%);
    box-shadow: 0 0 0.85rem color-mix(in srgb, var(--green) 36%, transparent);
}

.is-playing .mechanical-arm {
    animation: mechanical-swing var(--mechanical-duration, calc(var(--beat-duration, 750ms) * 2)) linear infinite;
    transition: none;
}

.metronome-dot-grid,
.metronome-figure-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.58rem;
    width: min(100%, 32rem);
}

.metronome-figure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.45rem, 5.85rem));
    align-items: end;
    justify-content: center;
    justify-items: center;
}

.metronome-dot,
.metronome-figure-beat {
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.metronome-dot {
    position: relative;
    display: grid;
    width: 3.4rem;
    height: 3.4rem;
    place-items: center;
    border-radius: 999px;
}

.metronome-dot::before {
    content: "";
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.metronome-dot.is-normal::before {
    background: color-mix(in srgb, var(--gold) 62%, transparent);
    border-color: var(--gold);
}

.metronome-dot.is-accent::before,
.metronome-dot.is-pattern-accent::before {
    width: 1.35rem;
    height: 1.35rem;
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 0.9rem color-mix(in srgb, var(--green) 38%, transparent);
}

.metronome-dot.is-muted {
    color: color-mix(in srgb, var(--muted) 50%, transparent);
    border-style: dashed;
}

.metronome-dot.is-muted::after {
    content: "";
    position: absolute;
    width: 1.8rem;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transform: rotate(-32deg);
}

.metronome-dot.is-compound-start,
.metronome-beat.is-compound-start {
    border-color: color-mix(in srgb, var(--gold) 46%, var(--line));
}

.metronome-dot.is-compound-subbeat,
.metronome-beat.is-compound-subbeat {
    opacity: 0.62;
}

.metronome-dot.is-active-group:not(.is-active) {
    box-shadow: 0 0 0 0.12rem color-mix(in srgb, var(--gold) 7%, transparent);
}

.metronome-dot.is-active,
.metronome-figure-beat.is-active {
    border-color: color-mix(in srgb, var(--gold) 72%, var(--line));
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--gold) 10%, transparent);
}

.metronome-dot.is-active {
    animation: metronome-dot-glow 220ms ease-out both;
}

.metronome-dot.is-active::before {
    animation: metronome-beat-glow 220ms ease-out both;
}

.metronome-visual-numbers {
    gap: 0.25rem;
}

.metronome-visual-numbers strong {
    color: var(--text);
    font-size: clamp(6rem, 25vw, 11rem);
    line-height: 0.85;
}

.metronome-count strong.is-compound-subbeat,
.metronome-visual-numbers strong.is-compound-subbeat {
    color: color-mix(in srgb, var(--text) 64%, transparent);
}

.metronome-count strong.is-ticking,
.metronome-visual-numbers strong.is-ticking {
    animation: metronome-number-tick 220ms ease-out both;
}

.metronome-visual-numbers span {
    color: var(--gold);
    font-weight: 900;
    text-transform: uppercase;
}

.figure-detail-toggle {
    position: absolute;
    top: 0.72rem;
    right: 0.9rem;
    z-index: 7;
    display: inline-flex;
    gap: 0.18rem;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 999px;
    padding: 0.16rem;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.figure-detail-toggle button {
    min-height: 1.62rem;
    border: 0;
    border-radius: 999px;
    padding: 0.18rem 0.48rem;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.figure-detail-toggle button.is-active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 28%, transparent), color-mix(in srgb, var(--green) 18%, transparent));
    color: var(--gold-strong);
}

.metronome-layout:not([data-active-view-mode="figures"]) .figure-detail-toggle {
    display: none;
}

.metronome-figure-beat {
    position: relative;
    display: grid;
    grid-template-rows: 1.35rem 3.8rem 1px 2.35rem;
    min-width: 3.28rem;
    min-height: 7.5rem;
    width: 100%;
    place-items: stretch;
    gap: 0;
    border-color: transparent;
    padding: 0.24rem 0.16rem 0.2rem;
    background: transparent;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.metronome-figure-beat:hover {
    transform: none;
}

.metronome-figure-beat:hover .figure-music-line {
    transform: none;
}

.figure-beat-divider {
    display: block;
    width: calc(100% - 0.72rem);
    height: 1px;
    justify-self: center;
    border-radius: 999px;
    background:
        linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 44%, var(--line)), color-mix(in srgb, var(--green) 34%, var(--line)), transparent);
    pointer-events: none;
}

.metronome-layout[data-figure-detail-mode="basic"] .metronome-figure-beat {
    grid-template-rows: 1fr;
    min-height: 4.55rem;
    padding-block: 0.34rem;
}

.metronome-figure-beat small {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1;
}

.metronome-figure-beat.is-selected {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--green);
}

.metronome-figure-beat.is-selected .rhythm-figure {
    animation: metronome-figure-glow 260ms ease-out both;
}

.metronome-figure-beat.is-active {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--gold-strong);
}

.metronome-figure-beat.is-active .rhythm-figure {
    animation: metronome-figure-glow 220ms ease-out both;
}

.metronome-figure-beat.is-selected.is-active {
    color: var(--green);
}

.has-subdivision-palette:not(.is-playing) .metronome-figure-beat.is-active:not(.is-selected) {
    border-color: transparent;
    box-shadow: none;
}

.has-subdivision-palette:not(.is-playing) .metronome-figure-beat.is-active:not(.is-selected):not(.is-pattern-accent) {
    color: var(--muted);
}

.has-subdivision-palette:not(.is-playing) .metronome-figure-beat.is-active:not(.is-selected) .rhythm-figure {
    animation: none;
}

.metronome-figure-beat .rhythm-figure-smufl {
    font-size: 2.55rem;
}

.metronome-figure-beat.is-active.is-pattern-accent .rhythm-figure {
    filter: drop-shadow(0 0 0.7rem color-mix(in srgb, var(--green) 48%, transparent));
}

.metronome-figure-beat.is-muted {
    opacity: 0.56;
    border-style: dashed;
}

.metronome-figure-beat.is-pattern-accent {
    color: var(--green);
}

.figure-subdivision-cue {
    position: relative;
    display: inline-grid;
    min-width: 1.42rem;
    height: 1.12rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--green) 38%, transparent);
    border-radius: 999px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--green) 10%, transparent),
            color-mix(in srgb, var(--gold) 8%, transparent));
    color: color-mix(in srgb, var(--green) 82%, var(--muted));
    font: inherit;
    font-size: 0.92rem;
    font-weight: 950;
    line-height: 1;
    opacity: 0.52;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.figure-subdivision-cue span {
    transform: translateY(-0.03rem);
}
.metronome-figure-beat:hover .figure-subdivision-cue,
.metronome-figure-beat.is-selected .figure-subdivision-cue {
    border-color: color-mix(in srgb, var(--green) 72%, var(--line));
    background: color-mix(in srgb, var(--green) 12%, transparent);
    opacity: 1;
}

.metronome-figure-beat.has-subdivision {
    gap: 0;
}

.figure-unit-row {
    display: grid;
    min-height: 1.35rem;
    place-items: center;
    pointer-events: none;
}

.figure-unit-row:not(.has-unit) {
    visibility: hidden;
}

.figure-music-line {
    display: grid;
    min-height: 3.8rem;
    place-items: end center;
    width: 100%;
    padding-bottom: 0.3rem;
    overflow: visible;
    transition: transform 140ms ease;
}

.figure-music-line.is-basic {
    min-height: 3.75rem;
    place-items: center;
    padding-bottom: 0;
}

.figure-info-line {
    display: grid;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    min-height: 2.35rem;
    padding-top: 0.48rem;
    color: currentColor;
}

.figure-info-line .figure-subdivision-cue {
    opacity: 0.42;
}

.figure-number-row,
.figure-action-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    min-width: 0;
}

.figure-action-row {
    min-height: 1.08rem;
    margin-top: 0.16rem;
}


.figure-subdivision-reset {
    display: inline-grid;
    width: 1rem;
    height: 1rem;
    place-items: center;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    color: color-mix(in srgb, #ff6b6b 78%, var(--muted));
    font: inherit;
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1;
    opacity: 0.72;
    cursor: pointer;
}

.figure-subdivision-reset:hover,
.figure-subdivision-reset:focus-visible {
    color: #ff7878;
    opacity: 1;
    outline: none;
}
.figure-beat-number {
    display: inline-grid;
    min-width: 1rem;
    place-items: center;
}

.figure-original-unit {
    display: inline-grid;
    place-items: center;
    color: color-mix(in srgb, currentColor 42%, transparent);
}

.figure-original-unit .rhythm-figure {
    width: 1.15rem;
    height: 1.28rem;
    transform: none;
    animation: none !important;
    filter: none !important;
}

.figure-original-unit .rhythm-figure-smufl {
    font-size: 1.28rem;
}
.figure-subdivision-preview {
    display: grid;
    place-items: end center;
    width: 100%;
    min-height: 3.45rem;
    color: currentColor;
    overflow: visible;
}

.figure-subdivision-preview .subdivision-vex {
    width: min(5.7rem, 100%);
    height: 3.45rem;
    overflow: visible;
}

.figure-subdivision-preview .subdivision-vex.has-tuplet svg,
.figure-drop-preview .subdivision-vex.has-tuplet svg {
    transform: translateY(-0.34rem);
}

.figure-subdivision-preview .subdivision-fallback {
    transform: scale(0.86);
}

.figure-subdivision-mini {
    position: absolute;
    left: 50%;
    top: calc(100% + 0.38rem);
    bottom: auto;
    z-index: 30;
    display: grid;
    width: min(20.5rem, calc(100vw - 1rem));
    gap: 0.42rem;
    border: 1px solid color-mix(in srgb, var(--green) 44%, var(--line));
    border-radius: 8px;
    padding: 0.48rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), color-mix(in srgb, var(--green) 7%, var(--surface)));
    box-shadow: 0 1rem 2rem color-mix(in srgb, #000 32%, transparent);
    transform: translateX(-50%);
}

.metronome-figure-grid > .metronome-figure-beat:first-child .figure-subdivision-mini,
.metronome-figure-group:first-child .figure-subdivision-mini {
    left: 0;
    transform: none;
}

.metronome-figure-grid > .metronome-figure-beat:last-child .figure-subdivision-mini,
.metronome-figure-group:last-child .figure-subdivision-mini {
    right: 0;
    left: auto;
    transform: none;
}

.figure-subdivision-mini-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.figure-subdivision-mini-heading strong {
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
}

.figure-subdivision-mini-heading button {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
}

.figure-subdivision-mini-heading button:hover,
.figure-subdivision-mini-heading button:focus-visible {
    color: var(--text);
    outline: none;
}

.figure-subdivision-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.28rem;
}

.figure-subdivision-mini-grid button {
    display: grid;
    min-height: 3.75rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    color: var(--muted);
    overflow: hidden;
    cursor: pointer;
}

.figure-subdivision-mini-grid button.is-active,
.figure-subdivision-mini-grid button:hover {
    border-color: color-mix(in srgb, var(--green) 58%, var(--line));
    background: color-mix(in srgb, var(--green) 12%, var(--surface));
    color: var(--green);
}

.figure-subdivision-mini .subdivision-vex {
    width: min(3.55rem, 100%);
    height: 3.05rem;
    overflow: visible;
}

.figure-subdivision-mini .subdivision-vex svg {
    overflow: visible;
}

.figure-subdivision-mini .subdivision-fallback {
    transform: scale(0.72);
}

.figure-drop-preview {
    position: absolute;
    inset: 0.15rem;
    z-index: 4;
    display: grid;
    place-items: center;
    border: 1px dashed color-mix(in srgb, var(--green) 72%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--green) 14%, var(--surface));
    color: var(--green);
    opacity: 0.86;
    pointer-events: none;
}

.figure-drop-preview .subdivision-vex {
    width: min(6.2rem, 100%);
    height: 3.45rem;
    overflow: visible;
}

.metronome-figure-beat.is-drop-preview {
    color: var(--green);
    transform: translateY(-2px);
}

.metronome-figure-beat strong {
    color: currentColor;
    font-size: 0.92rem;
    line-height: 1;
    transform: translate(0.04rem, 0.04rem);
}

.metronome-figure-beat.is-compound-subbeat {
    opacity: 0.58;
}

.metronome-figure-beat.is-compound-subbeat.is-selected,
.metronome-figure-beat.is-compound-subbeat.is-active {
    opacity: 1;
}

.metronome-figure-group {
    display: grid;
    width: 100%;
    gap: 0.42rem;
    justify-items: stretch;
    min-width: 0;
}

.compound-time-unit {
    display: grid;
    gap: 0.34rem;
    align-items: center;
    justify-items: center;
    min-height: 3.25rem;
    background: transparent;
    border: 0;
    color: color-mix(in srgb, var(--gold) 86%, var(--text));
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.compound-time-unit strong {
    font-size: 0.92rem;
    transform: translateY(-0.04rem);
}

.compound-time-unit .rhythm-figure {
    width: 1.15rem;
    height: 1.55rem;
}

.compound-time-unit .rhythm-figure-smufl {
    font-size: 1.48rem;
}

.compound-figure-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.18rem;
    align-items: start;
    width: 100%;
}

.is-compound-meter .metronome-figure-grid {
    display: grid;
    grid-template-columns: repeat(var(--compound-group-count, 2), minmax(0, 1fr));
    align-items: flex-start;
    gap: 0.62rem;
    width: min(100%, 46rem);
}

.is-compound-meter .metronome-figure-beat {
    min-width: 0;
    min-height: 7.5rem;
}

.metronome-layout[data-figure-detail-mode="basic"].is-compound-meter .compound-time-unit {
    display: none;
}

.metronome-layout[data-figure-detail-mode="basic"].is-compound-meter .metronome-figure-group {
    gap: 0;
}

.metronome-figure-group.is-active-group .compound-time-unit {
    color: var(--green);
    transform: translateY(-1px);
}

.metronome-figure-group.is-active-group .compound-time-unit .rhythm-figure {
    animation: compound-unit-pulse 180ms ease-out both;
}

.figure-subdivision-mark {
    display: flex;
    gap: 0.16rem;
    min-height: 0.5rem;
}

.figure-subdivision-mark i {
    display: block;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 72%, transparent);
}

.metronome-beats-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.64rem 0.8rem;
    align-items: center;
    border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
    padding-top: 0.75rem;
    overflow-anchor: none;
}

.metronome-beats-shell > span {
    display: none;
}

.metronome-beats-title {
    display: grid;
    gap: 0.36rem;
    min-width: 5.3rem;
}

.metronome-beats-title span {
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.metronome-subdivision-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

.subdivision-open-button,
.subdivision-clear-button-inline {
    min-height: 2rem;
    border-radius: 8px;
    padding: 0.28rem 0.58rem;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
}

.subdivision-open-button {
    border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
    background: color-mix(in srgb, var(--green) 10%, transparent);
    color: var(--green);
}

.subdivision-open-button.is-active {
    border-color: color-mix(in srgb, var(--gold) 70%, var(--green));
    background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 18%, transparent), color-mix(in srgb, var(--green) 14%, transparent));
    color: var(--gold-strong);
}

.subdivision-clear-button-inline {
    justify-self: auto;
    color: var(--gold-strong);
}

.metronome-subdivision-shell {
    display: grid;
    gap: 0.46rem;
}

.metronome-subdivision-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
    border-radius: 8px;
    padding: 0.58rem 0.66rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
}

.metronome-subdivision-header > div:first-child {
    display: grid;
    gap: 0.08rem;
}

.metronome-subdivision-header span {
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
}

.metronome-subdivision-header small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.metronome-beats-title small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.12;
}

.metronome-beat-grid {
    display: grid;
    grid-column: 2;
    grid-template-columns: repeat(auto-fit, minmax(3.15rem, 1fr));
    gap: 0.42rem;
}

.metronome-beat {
    display: grid;
    min-height: 2.45rem;
    place-items: center;
    gap: 0.03rem;
    border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--line));
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--blue) 7%, var(--surface)), color-mix(in srgb, var(--surface) 88%, transparent));
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.metronome-beat:hover {
    transform: translateY(-1px);
}

.metronome-beat strong {
    font-size: 0.95rem;
    line-height: 1;
}

.metronome-beat small {
    color: currentColor;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.78;
}

.metronome-beat.is-active {
    border-color: color-mix(in srgb, var(--gold) 70%, var(--line));
    background: color-mix(in srgb, var(--gold) 18%, var(--surface));
    color: var(--gold-strong);
}

.metronome-beat.is-accent {
    border-color: color-mix(in srgb, var(--green) 72%, var(--line));
    background: color-mix(in srgb, var(--green) 20%, var(--surface));
    color: var(--green);
}

.metronome-beat.is-muted {
    border-style: dashed;
    background: transparent;
    color: color-mix(in srgb, var(--muted) 58%, transparent);
}

.metronome-beat.is-pattern-accent {
    border-color: color-mix(in srgb, var(--green) 58%, var(--line));
    background: color-mix(in srgb, var(--green) 12%, var(--surface));
    color: var(--green);
}

.metronome-bpm-control {
    --metronome-side-control-width: 12.35rem;
    display: grid;
    gap: 0.54rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
    padding-top: 0.58rem;
}

.metronome-bpm-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    margin: 0.32rem 0 0.4rem;
}

.metronome-step-group {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 0.32rem;
    justify-content: start;
}

.metronome-step-button {
    display: grid;
    min-width: 2.85rem;
    min-height: 2.28rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), color-mix(in srgb, var(--surface) 90%, transparent));
    color: var(--gold-strong);
    font: inherit;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.metronome-step-button span {
    font-size: 0.9rem;
}

.metronome-step-button small {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 900;
}

.metronome-step-button:hover {
    border-color: color-mix(in srgb, var(--gold) 62%, var(--line));
    background: color-mix(in srgb, var(--gold) 17%, var(--surface));
}

.metronome-bpm-field,
.custom-meter-panel label,
.metronome-volume-field {
    display: grid;
    gap: 0.32rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.metronome-bpm-field input,
.custom-meter-panel input,
.custom-meter-panel select {
    min-height: 2.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    color: var(--text);
    font: inherit;
    font-weight: 900;
}

.metronome-bpm-field input {
    width: 5.2rem;
    text-align: center;
}

.custom-meter-panel input {
    width: 4.5rem;
    text-align: center;
}

.custom-meter-panel select {
    width: 100%;
    min-width: 0;
}

.metronome-range,
.metronome-volume-field input {
    width: 100%;
    accent-color: var(--gold);
}

.metronome-range {
    min-height: 1.45rem;
    margin-top: 0.1rem;
}

.metronome-range::-webkit-slider-runnable-track {
    height: 0.48rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--green) 78%, transparent), color-mix(in srgb, var(--blue) 58%, transparent));
}

.metronome-range::-webkit-slider-thumb {
    margin-top: -0.37rem;
}

.metronome-bpm-presets-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem 0.48rem;
    align-items: center;
}

.metronome-presets-label {
    display: inline-flex;
    flex: 0 0 min(100%, var(--metronome-side-control-width));
    align-items: center;
    justify-content: center;
    min-height: 2.28rem;
    border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
    border-radius: 8px;
    padding: 0.24rem 0.5rem;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--blue) 8%, var(--surface)), color-mix(in srgb, var(--surface) 92%, transparent));
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

.metronome-bpm-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32rem;
}

.metronome-bpm-presets button {
    display: grid;
    min-width: 2.85rem;
    min-height: 2.28rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: 8px;
    padding: 0.26rem 0.34rem;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), color-mix(in srgb, var(--surface) 90%, transparent));
    color: var(--gold-strong);
    font: inherit;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.metronome-bpm-presets button span {
    font-size: 0.86rem;
}

.metronome-bpm-presets button small {
    color: var(--muted);
    font-size: 0.55rem;
    font-weight: 900;
}

.metronome-bpm-presets button:hover,
.metronome-bpm-presets button.is-active {
    border-color: color-mix(in srgb, var(--gold) 58%, var(--line));
    background: color-mix(in srgb, var(--gold) 14%, var(--surface));
    color: var(--gold-strong);
}

.metronome-tap-button {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    width: min(100%, var(--metronome-side-control-width));
    min-height: 2.72rem;
    border-color: color-mix(in srgb, var(--gold) 64%, var(--line));
    background: linear-gradient(180deg, var(--gold), var(--gold-strong));
    color: #171003;
    font-size: 0.95rem;
    font-weight: 950;
    justify-self: start;
    white-space: nowrap;
}

.metronome-tap-button.is-keyboard-active {
    border-color: color-mix(in srgb, var(--green) 76%, var(--line));
    background: linear-gradient(180deg, color-mix(in srgb, var(--green) 86%, white), var(--green));
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--green) 13%, transparent);
}

.metronome-tap-status {
    flex: 1 1 12rem;
    max-width: 25rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1.3;
}

.is-tap-keyboard-mode .metronome-tap-status {
    color: var(--green);
}

.tap-icon {
    position: relative;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    color: currentColor;
    font-size: inherit;
}

.tap-icon::before,
.tap-icon::after {
    content: "";
    position: absolute;
    border-radius: 999px;
}

.tap-icon::before {
    left: 0.42rem;
    top: 0.08rem;
    width: 0.22rem;
    height: 0.58rem;
    border: 0;
    border-radius: 999px 999px 0.2rem 0.2rem;
    background: currentColor;
}

.tap-icon::after {
    left: 50%;
    bottom: 0.05rem;
    width: 0.78rem;
    height: 0.36rem;
    border: 2px solid currentColor;
    border-top: 0;
    background: transparent;
    opacity: 0.9;
    transform: translateX(-50%);
}

.metronome-tap-button span {
    color: var(--gold);
    font-size: 0.82rem;
}

.metronome-tap-button .tap-icon {
    color: #171003;
}

.metronome-side-panel {
    display: grid;
    gap: 1.25rem;
}

.metronome-settings-panel {
    gap: 0.85rem;
}

.meter-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.25rem;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-soft) 52%, transparent);
}

.meter-mode-switch button {
    min-height: 2.3rem;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

.meter-mode-switch button:hover,
.meter-mode-switch button.is-active {
    border-color: color-mix(in srgb, var(--green) 46%, transparent);
    background: color-mix(in srgb, var(--green) 12%, var(--surface));
    color: var(--green);
}

.meter-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.meter-preset-grid button {
    min-height: 3.65rem;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    color: var(--muted);
    font: inherit;
    font-size: inherit;
    font-weight: 900;
    line-height: 1;
    overflow: hidden;
    padding-inline: 0.36rem;
    cursor: pointer;
}

.meter-preset-grid .time-signature {
    font-size: 1.62rem;
}

.meter-preset-grid [data-meter-custom] {
    font-size: clamp(0.78rem, 1.7vw, 1rem);
}

.metronome-layout[data-figure-detail-mode="basic"] .metronome-figure-beat:focus-visible {
    border-color: color-mix(in srgb, var(--green) 68%, var(--line));
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--green) 14%, transparent);
    outline: none;
}

.meter-preset-grid button:hover,
.meter-preset-grid button.is-active {
    border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
    background: color-mix(in srgb, var(--gold) 14%, var(--surface));
    color: var(--gold-strong);
}

.custom-meter-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: end;
}

.rhythm-note-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.42rem;
}

.rhythm-note-card {
    display: grid;
    min-height: 6.5rem;
    place-items: center;
    gap: 0.1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.28rem;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    color: var(--muted);
    font: inherit;
    text-align: center;
    cursor: pointer;
    min-width: 0;
}

.rhythm-note-card:hover {
    border-color: color-mix(in srgb, var(--green) 40%, var(--line));
    background: color-mix(in srgb, var(--green) 7%, var(--surface));
    color: var(--text);
}

.rhythm-note-card.is-active {
    border-color: color-mix(in srgb, var(--green) 58%, var(--line));
    background: color-mix(in srgb, var(--green) 12%, var(--surface));
    color: var(--green);
}

.rhythm-note-card strong {
    font-size: 1rem;
}

.rhythm-note-card small {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rhythm-figure {
    position: relative;
    display: inline-grid;
    width: 2rem;
    height: 2.7rem;
    align-items: center;
    color: currentColor;
    flex: 0 0 auto;
    justify-items: center;
    line-height: 1;
}

.rhythm-figure-smufl {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    font-family: "Bravura", serif;
    font-size: 2.55rem;
    font-style: normal;
    font-weight: 400;
    text-rendering: geometricPrecision;
}

.rhythm-figure-smufl.is-dotted {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.02em;
}

.rhythm-glyph,
.rhythm-dot {
    display: block;
    font-family: "Bravura", serif;
    line-height: 1;
}

.rhythm-glyph {
    transform: translateY(-0.03em);
}

.rhythm-dot {
    align-self: center;
    margin-left: -0.04em;
    font-size: 0.46em;
    transform: translateY(0.1em);
}

.rhythm-card-symbol {
    display: grid;
    width: 2rem;
    height: 2.7rem;
    place-items: center;
}

.rhythm-card-symbol .rhythm-figure-smufl {
    font-size: 2.55rem;
}

.rhythm-card-symbol .rhythm-glyph {
    transform: translateY(0.16em);
}

.rhythm-card-symbol .note-thirty-second .rhythm-glyph {
    transform: translateY(0.27em);
}

.metronome-toggle-row {
    margin-bottom: 0;
}

.meter-theory-strip {
    display: grid;
    gap: 0.26rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    padding-top: 0.86rem;
}

.meter-theory-strip strong {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.48rem;
    align-items: center;
    min-height: 1.95rem;
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1;
}

.meter-theory-strip strong > span:last-child {
    align-self: center;
    transform: none;
}

.meter-chip-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 950;
    white-space: nowrap;
}

.meter-chip-figures {
    display: inline-flex;
    gap: 0.18rem;
    align-items: center;
    justify-content: flex-start;
    align-self: center;
    min-width: 0;
    min-height: 1.95rem;
    color: var(--gold-strong);
    transform: none;
}

.meter-chip-figures .rhythm-figure {
    width: 1.34rem;
    height: 1.9rem;
}

.meter-chip-figures .rhythm-figure-smufl {
    font-size: 1.8rem;
}

.meter-chip-figures .rhythm-glyph,
.meter-chip-figures .rhythm-dot {
    transform: translateY(0.13em);
}

.theory-tie,
.subdivision-tie {
    position: relative;
    display: inline-block;
    width: 0.62rem;
    height: 0.55rem;
    align-self: end;
}

.theory-tie::before,
.subdivision-tie::before {
    content: "";
    position: absolute;
    left: 0.06rem;
    right: 0.06rem;
    bottom: 0.08rem;
    height: 0.36rem;
    border-bottom: 2px solid currentColor;
    border-radius: 0 0 999px 999px;
    opacity: 0.78;
}

.meter-theory-strip small {
    display: grid;
    gap: 0.05rem;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.18;
}

.subdivision-popover {
    display: grid;
    grid-column: 1 / -1;
    gap: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--green) 32%, var(--line));
    border-radius: 8px;
    padding: 0.8rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, var(--surface-strong)), color-mix(in srgb, var(--surface) 92%, transparent));
    overflow-anchor: none;
    scroll-margin-top: 1rem;
}

.subdivision-popover[hidden] {
    display: none;
}

.subdivision-popover-heading {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.subdivision-popover-heading strong {
    font-size: 1rem;
}

.subdivision-popover-heading button {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    margin-left: auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.subdivision-option-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.36rem;
}

.subdivision-option-grid button {
    position: relative;
    display: grid;
    min-height: 4.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.subdivision-vex {
    position: relative;
    display: none;
    width: 7.75rem;
    max-width: 100%;
    height: 4.35rem;
    color: currentColor;
}

.subdivision-option-grid .subdivision-vex {
    transform: translateY(-0.08rem);
}

.subdivision-option-grid [data-subdivision-option="none"] .subdivision-fallback-visible {
    transform: translateY(0.3rem);
}

.subdivision-option-grid .subdivision-vex[data-vex-subdivision="semi-pontuada"] {
    width: 8.15rem;
    transform: translate(0.28rem, -0.08rem) scale(1.04);
}

.subdivision-vex.is-rendered {
    display: block;
}

.subdivision-vex.is-rendered + .subdivision-fallback {
    display: none;
}

.subdivision-vex svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.subdivision-vex svg .vf-stave {
    display: none;
}

.subdivision-vex svg path,
.subdivision-vex svg line {
    fill: currentColor;
    stroke: currentColor;
}

.subdivision-vex svg text {
    fill: var(--gold);
    stroke: none;
    font-weight: 900;
}

.subdivision-option-grid .subdivision-vex.has-tuplet svg {
    transform: translateY(-0.58rem);
}

.figure-subdivision-mini .subdivision-vex.has-tuplet svg {
    transform: translateY(-0.34rem);
}

.subdivision-vex-tuplet {
    position: absolute;
    left: 50%;
    bottom: 0.16rem;
    z-index: 2;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 950;
    line-height: 1;
    transform: translateX(-50%);
    pointer-events: none;
}

.subdivision-fallback-visible {
    position: relative;
    display: grid;
    place-items: center;
}

.subdivision-option-grid .subdivision-fallback-visible .rhythm-figure {
    width: 2.35rem;
    height: 3.15rem;
}

.subdivision-option-grid .subdivision-fallback-visible .rhythm-figure-smufl {
    font-size: 2.95rem;
}

.figure-subdivision-mini .subdivision-fallback-visible .rhythm-figure {
    width: 1.85rem;
    height: 2.45rem;
}

.figure-subdivision-mini .subdivision-fallback-visible .rhythm-figure-smufl {
    font-size: 2.25rem;
}

.figure-subdivision-mini [data-subdivision-option="none"] .subdivision-fallback-visible {
    transform: translateY(0.12rem) scale(0.68);
}

.subdivision-option-grid button:hover,
.subdivision-option-grid button.is-active,
.subdivision-option-grid button.is-armed {
    border-color: color-mix(in srgb, var(--green) 58%, var(--line));
    background: color-mix(in srgb, var(--green) 13%, var(--surface));
    color: var(--green);
}

.subdivision-clear-button {
    justify-self: start;
    min-height: 2.1rem;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: 8px;
    padding: 0.32rem 0.65rem;
    background: color-mix(in srgb, var(--gold) 8%, transparent);
    color: var(--gold-strong);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
}

.subdivision-clear-button:hover {
    background: color-mix(in srgb, var(--gold) 14%, var(--surface));
}

.subdivision-figure-sequence {
    position: relative;
    display: inline-flex;
    gap: 0.18rem;
    align-items: end;
    justify-content: center;
    min-width: 2.3rem;
    color: currentColor;
}

.subdivision-figure-sequence .rhythm-figure {
    width: 1.4rem;
    height: 1.95rem;
}

.subdivision-figure-sequence .rhythm-figure-smufl {
    font-size: 1.84rem;
}

.subdivision-tuplet {
    position: absolute;
    left: 0;
    right: 0;
    top: -0.58rem;
    color: var(--gold);
    font-size: 0.62rem;
    font-weight: 950;
    text-align: center;
}

.subdivision-none-mark {
    position: absolute;
    width: 2.5rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.62;
    transform: rotate(-22deg);
}

.tools-coming-section {
    padding-top: 0;
}

.tools-coming-grid {
    display: grid;
    gap: 1rem;
}

.tool-coming-card {
    padding: 1.2rem;
    color: inherit;
    text-decoration: none;
}

.tool-coming-card h2 {
    margin-top: 0.35rem;
}

.tool-coming-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.collapsible-dashboard-calendar > summary {
    cursor: pointer;
    list-style: none;
}

.collapsible-dashboard-calendar > summary::-webkit-details-marker {
    display: none;
}

.collapsible-dashboard-calendar > summary::after {
    content: "⌄";
    color: var(--gold);
    font-size: 1.3rem;
    transition: transform 160ms ease;
}

.collapsible-dashboard-calendar[open] > summary::after {
    transform: rotate(180deg);
}

/* Comunicações do professor */
.communications-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(18rem, .75fr);
    gap: 18px;
    align-items: start;
}

.communication-panel-heading,
.communication-send-row,
.communication-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.communication-panel-heading p { margin: 4px 0 0; }
.communication-form { display: grid; gap: 14px; margin-top: 16px; }
.communication-form label { display: grid; gap: 6px; }
.communication-form label > span { font-weight: 700; }
.communication-form input,
.communication-form select,
.communication-form textarea {
    width: 100%;
    min-height: 2.65rem;
    padding: .68rem .78rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.communication-form select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.45rem;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 1.18rem) 50%, calc(100% - .82rem) 50%;
    background-size: .38rem .38rem, .38rem .38rem;
    background-repeat: no-repeat;
}
.communication-form-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.communication-form textarea { min-height: 10rem; resize: vertical; }
.communication-confirm { flex: 1 1 16rem; max-width: 25rem; }
.communication-confirm small,
.communication-audience-panel .field-help { color: var(--muted); font-size: .78rem; }
.communication-actions { justify-content: flex-end; flex-wrap: wrap; }

.communication-counts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    align-items: baseline;
    margin: 14px 0 4px;
}
.communication-counts strong { color: var(--accent); font-size: 1.55rem; }
.communication-audience-panel details { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.communication-audience-panel summary { cursor: pointer; font-weight: 750; }
.communication-recipient-list { margin-top: 9px; max-height: 20rem; overflow: auto; }
.communication-recipient-list li { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.communication-recipient-list li:last-child { border-bottom: 0; }
.communication-recipient-list span,
.communication-recipient-list small { color: var(--muted); overflow-wrap: anywhere; }
.communication-recipient-list form { margin-top: 5px; }
.communication-history { padding-top: 0; }
.communication-history .compact-list li { position: relative; padding-right: 8.5rem; }
.communication-history .status-chip { position: absolute; top: 12px; right: 12px; }
.communication-history .button { justify-self: start; margin-top: 6px; }
.communication-preference-shell { padding-top: clamp(3rem, 9vh, 7rem); }
.communication-preference-shell h1 { margin-bottom: 10px; }

.daily-tips-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.google-connection-summary {
    display: block;
    margin-top: .18rem;
    color: var(--muted);
    font-weight: 550;
}

.google-connection-state {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .38rem .62rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.google-connection-state > span {
    width: .55rem;
    height: .55rem;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.google-connection-state.is-connected {
    border-color: color-mix(in srgb, var(--green) 42%, var(--line));
    color: var(--green);
    background: color-mix(in srgb, var(--green) 7%, transparent);
}

.google-connection-state.is-connected > span {
    border: 0;
    background: currentColor;
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--green) 15%, transparent);
}

.daily-tip-editor {
    position: static;
}

.daily-tip-media {
    margin-top: .5rem;
    border-top: 1px solid var(--line);
    padding-top: .45rem;
}

.daily-tip-media summary {
    width: max-content;
    color: var(--gold);
    font-weight: 800;
    cursor: pointer;
}

.daily-tip-media > div {
    position: relative;
    width: min(30rem, 100%);
    aspect-ratio: 16 / 9;
    margin-top: .55rem;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.daily-tip-media iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.daily-tip-link { margin-top: .4rem; }

.daily-tip-form,
.daily-tip-list {
    display: grid;
    gap: 0.75rem;
}

.daily-tip-date-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(8rem, 1fr)) auto;
    gap: 0.65rem;
    align-items: end;
}

.daily-tip-date-row input[type="date"] {
    width: 100%;
    max-width: 10.5rem;
}

.daily-tip-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--line);
}

.daily-tip-row:first-child { border-top: 0; }
.daily-tip-row > div:first-child { display: grid; gap: 0.18rem; min-width: 0; }
.daily-tip-row small,
.daily-tip-row > div:first-child > span { color: var(--muted); }
.daily-tip-row p { margin: 0.1rem 0; }
.daily-tip-row.is-muted { opacity: 0.64; }
.daily-tip-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.daily-tip-actions form { margin: 0; }

@media (max-width: 860px) {
    .communications-layout { grid-template-columns: 1fr; }
    .daily-tips-layout { grid-template-columns: 1fr; }
    .daily-tip-editor { position: static; }
    .communication-send-row { align-items: stretch; flex-direction: column; }
    .communication-confirm { max-width: none; }
    .communication-actions { width: 100%; }
    .communication-actions .button { flex: 1 1 12rem; }
}

@media (max-width: 560px) {
    .communication-form-top { grid-template-columns: 1fr; }
    .communication-actions { display: grid; grid-template-columns: 1fr; }
    .communication-history .compact-list li { padding-right: 0; }
    .communication-history .status-chip { position: static; justify-self: start; }
    .daily-tip-date-row,
    .daily-tip-row { grid-template-columns: 1fr; }
    .daily-tip-actions { justify-content: flex-start; }
}

.metronome-tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.65rem;
    align-items: center;
    justify-content: center;
    width: min(34rem, calc(100% - 2rem));
    margin: 0.85rem auto 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    color: var(--muted);
    font-size: 0.76rem;
}

.metronome-tool-links > span:first-child {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.metronome-tool-links a {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    color: var(--muted);
    font-weight: 750;
    text-decoration: none;
}

.metronome-tool-links a:hover,
.metronome-tool-links a:focus-visible {
    color: var(--gold);
}

.metronome-tool-links .nav-icon {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 0.9rem;
}

.metronome-tool-separator {
    opacity: 0.46;
}

/* Public home — audience-first presentation */
.public-home {
    background:
        radial-gradient(circle at 82% 8%, rgba(57, 166, 183, 0.1), transparent 28rem),
        radial-gradient(circle at 14% 34%, rgba(244, 179, 33, 0.07), transparent 30rem),
        var(--bg);
}

.home-shell {
    width: min(74rem, calc(100% - 2rem));
    margin-inline: auto;
}

.home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background-image:
        linear-gradient(90deg, rgba(7, 8, 10, 0.98) 0%, rgba(7, 8, 10, 0.91) 48%, rgba(7, 8, 10, 0.7) 100%),
        var(--hero-image);
    background-position: center;
    background-size: cover;
}

.home-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 72% 42%, rgba(244, 179, 33, 0.14), transparent 24rem),
        linear-gradient(180deg, transparent 68%, rgba(7, 8, 10, 0.86));
}

.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.84fr) minmax(28rem, 1.16fr);
    gap: clamp(1.25rem, 3.2vw, 3.5rem);
    align-items: center;
    min-height: 38rem;
    padding-block: clamp(1.25rem, 3vw, 2.25rem);
}

.home-hero-copy {
    position: relative;
    z-index: 3;
}

.home-hero-logo {
    display: block;
    width: min(13rem, 72vw);
    height: auto;
    margin: 0 0 -0.15rem -0.35rem;
    filter: drop-shadow(0 0.8rem 1.7rem rgba(0, 0, 0, 0.5));
}

.home-hero-copy .eyebrow {
    margin: 0 0 0.85rem;
}

.home-hero-copy h1 {
    max-width: 34rem;
    margin: 0;
    font-size: clamp(2.25rem, 4vw, 3.5rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    text-transform: none;
}

.home-hero-copy > p:not(.eyebrow) {
    max-width: 36rem;
    margin: 1.15rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    line-height: 1.55;
}

.home-hero-actions,
.home-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.home-hero-actions {
    margin-top: 1.55rem;
}

.home-hero-actions .button {
    min-height: 3.15rem;
}

.home-demo-stage {
    position: relative;
    display: grid;
    align-items: end;
    min-height: 24rem;
    padding-top: 5.5rem;
}

.home-demo-stage > .home-hero-dodo {
    position: absolute;
    z-index: 3;
    top: -0.35rem;
    right: clamp(-3.5rem, -3vw, -0.75rem);
    pointer-events: none;
}

.home-material-demo {
    position: relative;
    z-index: 2;
    overflow: hidden;
    padding: clamp(1rem, 3vw, 1.45rem);
    border: 1px solid rgba(247, 248, 250, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(90deg, rgba(244, 179, 33, 0.82), rgba(64, 209, 177, 0.5)) top / 100% 1px no-repeat,
        rgba(16, 17, 20, 0.94);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(12px);
}

.home-demo-label {
    display: inline-flex;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(244, 179, 33, 0.34);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-demo-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    margin-top: 1rem;
}

.home-demo-note {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border: 1px solid rgba(244, 179, 33, 0.42);
    border-radius: 50%;
    background: rgba(244, 179, 33, 0.1);
    color: var(--gold);
    font-family: "Bravura", serif;
    font-size: 1.6rem;
    line-height: 1;
}

.home-demo-note > span {
    display: block;
    line-height: 1;
    transform: translate(0.07rem, 0.55rem);
}

.home-demo-heading h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2.4vw, 1.65rem);
    line-height: 1.15;
    text-transform: none;
}

.home-demo-heading p {
    margin: 0.28rem 0 0;
    color: var(--green);
    font-size: 0.88rem;
    font-weight: 800;
}

.home-demo-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.home-demo-resource {
    display: inline-flex;
    gap: 0.48rem;
    align-items: center;
    min-height: 2.55rem;
    padding: 0.55rem 0.78rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: default;
}

.resource-kind-icon.resource-kind-audio {
    width: 1.05rem;
    height: 0.9rem;
    border: 0.14rem solid var(--rose);
    border-bottom: 0;
    border-radius: 0.8rem 0.8rem 0 0;
}

.resource-kind-icon.resource-kind-audio::before,
.resource-kind-icon.resource-kind-audio::after {
    content: "";
    position: absolute;
    top: 0.46rem;
    width: 0.22rem;
    height: 0.46rem;
    border-radius: 0.2rem;
    background: var(--rose);
}

.resource-kind-icon.resource-kind-audio::before { left: -0.12rem; }
.resource-kind-icon.resource-kind-audio::after { right: -0.12rem; }

.home-demo-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin: 1.15rem 0 0.4rem;
    font-size: 0.82rem;
}

.home-demo-progress-label span { color: var(--muted); }
.home-demo-progress-label strong { color: var(--text); }
.home-material-demo .home-demo-progress {
    height: 0.72rem;
    border: 1px solid rgba(101, 214, 194, 0.18);
    background: rgba(247, 248, 250, 0.11);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.42);
}

.home-demo-progress > span {
    position: relative;
    width: var(--demo-progress);
    overflow: hidden;
    box-shadow: 0 0 0.9rem rgba(64, 209, 177, 0.34);
    animation: home-demo-progress-fill 1.35s cubic-bezier(.2, .76, .18, 1) both;
}

.home-demo-progress > span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, 0.5) 48%, transparent 78%);
    transform: translateX(-135%);
    animation: home-demo-progress-shine 2.8s 1.1s ease-in-out infinite;
}

@keyframes home-demo-progress-fill {
    from { width: 0; }
    to { width: var(--demo-progress); }
}

@keyframes home-demo-progress-shine {
    0%, 52% { transform: translateX(-135%); }
    82%, 100% { transform: translateX(135%); }
}

@media (prefers-reduced-motion: reduce) {
    .home-demo-progress > span {
        animation: none;
    }

    .home-demo-progress > span::after {
        display: none;
    }
}

.home-audience,
.home-section {
    padding-block: clamp(2.25rem, 4vw, 3.75rem);
}

.home-audience {
    border-bottom: 1px solid var(--line);
}

.home-section-heading {
    max-width: 52rem;
    margin-bottom: 1.65rem;
}

.home-section-heading-centered {
    margin-inline: auto;
    text-align: center;
}

.home-section-heading h2,
.home-section-copy h2,
.home-tools-copy h2,
.home-install-panel h2,
.home-rafael-grid h2 {
    margin: 0.25rem 0 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
    text-transform: none;
}

.home-section-heading > p,
.home-section-copy > p,
.home-tools-copy > p,
.home-install-panel p,
.home-rafael-grid p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.home-path-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.home-path-card,
.home-teacher-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(90deg, rgba(244, 179, 33, 0.78), rgba(64, 209, 177, 0.4)) top / 100% 1px no-repeat,
        var(--surface);
}

.home-path-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.3rem 0.9rem;
    align-items: center;
    padding: 1.25rem;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.home-path-card:hover {
    border-color: rgba(244, 179, 33, 0.5);
    background:
        linear-gradient(90deg, var(--gold), var(--green)) top / 100% 1px no-repeat,
        var(--surface-strong);
    transform: translateY(-0.18rem);
}

.home-symbol {
    position: relative;
    display: inline-grid;
    width: 2.7rem;
    height: 2.7rem;
    grid-row: 1 / span 3;
    place-items: center;
    border: 1px solid color-mix(in srgb, currentColor 42%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, currentColor 9%, transparent);
    color: var(--gold);
}

.home-symbol svg,
.home-metronome-symbol svg {
    width: 1.55rem;
    height: 1.55rem;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-symbol-fill {
    fill: currentColor;
    stroke: none;
}

.home-path-card.is-student .home-symbol { color: var(--rose); }
.home-path-card.is-teacher .home-symbol { color: var(--blue); }

.home-path-card strong {
    font-size: 1.1rem;
}

.home-path-card > span:not(.home-symbol) {
    color: var(--muted);
    line-height: 1.45;
}

.home-path-card b {
    margin-top: 0.25rem;
    color: var(--gold);
    font-size: 0.8rem;
}

.home-student-section {
    background: rgba(255, 255, 255, 0.015);
}

.home-feature-split,
.home-rafael-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(28rem, 1.1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.home-check-list {
    display: grid;
    gap: 0.65rem;
    margin: 1.35rem 0 0;
    padding: 0;
    list-style: none;
}

.home-check-list li {
    position: relative;
    padding-left: 1.65rem;
    color: var(--muted);
}

.home-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 900;
}

.home-student-preview,
.home-finance-preview {
    overflow: hidden;
    border: 1px solid rgba(247, 248, 250, 0.17);
    border-radius: 14px;
    background:
        linear-gradient(90deg, rgba(244, 179, 33, 0.78), rgba(64, 209, 177, 0.46)) top / 100% 1px no-repeat,
        rgba(16, 17, 20, 0.9);
    box-shadow: var(--shadow);
}

.home-preview-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
}

.home-preview-top span { color: var(--gold); font-weight: 900; }
.home-preview-top small { color: var(--muted); }

.home-preview-row {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.82rem 1rem;
    border-bottom: 1px solid var(--line);
}

.home-preview-row:last-child { border-bottom: 0; }
.home-preview-row > span:first-child { position: relative; width: 1.2rem; height: 1.2rem; color: var(--gold); }
.home-preview-row div { display: grid; min-width: 0; }
.home-preview-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-preview-row small { color: var(--muted); }
.home-preview-row > b { color: var(--green); }

.home-teacher-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.home-teacher-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.3rem 0.9rem;
    padding: 1.2rem;
}

.home-teacher-card .home-symbol { grid-row: 1 / span 2; }
.home-teacher-card:first-child .home-symbol { color: var(--green); }
.home-teacher-card:nth-child(2) .home-symbol { color: var(--blue); }
.home-teacher-card h3 { margin: 0; font-size: 1.15rem; }
.home-teacher-card p { margin: 0.2rem 0 0; color: var(--muted); line-height: 1.5; }

.home-finance-card {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 0.88fr) minmax(26rem, 1.12fr);
    gap: clamp(1.25rem, 4vw, 3rem);
    align-items: center;
    overflow: hidden;
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid rgba(64, 209, 177, 0.3);
    border-radius: 16px;
    background:
        linear-gradient(90deg, rgba(244, 179, 33, 0.9), rgba(64, 209, 177, 0.7)) top / 100% 1px no-repeat,
        linear-gradient(135deg, rgba(64, 209, 177, 0.08), rgba(244, 179, 33, 0.04)),
        var(--surface);
}

.home-finance-copy .home-symbol { float: left; margin: 0 0.8rem 0.45rem 0; }
.home-finance-symbol { color: var(--gold); }
.home-finance-copy h3 { margin: 0.25rem 0 0; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.12; }
.home-finance-copy p { color: var(--muted); line-height: 1.55; }
.home-finance-copy small { display: block; color: var(--green); line-height: 1.5; }

.home-finance-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    box-shadow: none;
}

.home-finance-preview > div {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.home-finance-preview > div:last-of-type { border-right: 0; }
.home-finance-preview > div span { color: var(--muted); font-size: 0.72rem; }
.home-finance-preview > div strong { font-size: clamp(0.95rem, 2vw, 1.2rem); }
.home-finance-preview > div.is-open strong { color: var(--rose); }
.home-finance-preview p {
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 0.58rem 0.9rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}
.home-finance-preview p:last-child { border-bottom: 0; }
.home-finance-preview p b { color: var(--text); white-space: nowrap; }

.home-teacher-cta {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.home-teacher-cta strong { font-size: 1.15rem; }
.home-teacher-cta p { margin: 0.2rem 0 0; color: var(--muted); }
.home-inline-actions { justify-content: flex-end; }
.home-school-link { color: var(--gold); font-size: 0.8rem; font-weight: 800; text-decoration: none; }
.home-school-link:hover { text-decoration: underline; }

.home-tools-section {
    border-block: 1px solid var(--line);
    background: rgba(244, 179, 33, 0.025);
}

.home-tools-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(14rem, 0.62fr);
    gap: clamp(1rem, 4vw, 2.5rem);
    align-items: center;
}

.home-tools-dodo { margin-block: -2rem; }
.home-tools-eyebrow { display: inline-flex; gap: 0.55rem; align-items: center; }
.home-metronome-symbol {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--gold) 9%, transparent);
    color: var(--gold);
}
.home-metronome-symbol svg { width: 1.25rem; height: 1.25rem; }
.home-tools-copy p { max-width: 38rem; }
.home-tool-mini-list { display: grid; gap: 0.6rem; }
.home-tool-mini-list a {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 0 0.65rem;
    align-items: center;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    text-decoration: none;
}
.home-tool-mini-list a:hover { border-color: rgba(244, 179, 33, 0.45); }
.home-tool-mini-list a > span { position: relative; display: grid; width: 1.6rem; height: 1.6rem; grid-row: 1 / span 2; place-items: center; color: var(--gold); }
.home-tool-mini-list small { color: var(--muted); font-size: 0.66rem; }
.home-tool-mini-list .tuner-icon::before { content: "440"; font-size: 0.55rem; font-weight: 900; }
.home-tool-mini-list .tuner-icon { border: 1px solid var(--green); border-radius: 50%; color: var(--green); }
.home-tool-mini-list .keyboard-icon::before { content: ""; width: 1.4rem; height: 0.82rem; border: 1px solid var(--text); border-radius: 0.16rem; background: repeating-linear-gradient(90deg, transparent 0 0.25rem, var(--line) 0.25rem 0.3rem); }

.home-install-section { padding-block: 1.5rem; }
.home-install-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(90deg, rgba(244, 179, 33, 0.65), rgba(64, 209, 177, 0.35)) top / 100% 1px no-repeat,
        var(--surface);
}
.home-install-panel h2 { font-size: 1.4rem; }
.home-install-panel p { margin: 0.3rem 0 0; font-size: 0.88rem; }
.home-install-panel .home-install-help { color: var(--gold); }

.home-rafael-section { background: rgba(255, 255, 255, 0.015); }
.home-rafael-grid { grid-template-columns: minmax(16rem, 0.65fr) minmax(0, 1fr); }
.home-rafael-grid > img { display: block; width: 100%; max-height: 30rem; object-fit: cover; object-position: center 28%; border: 1px solid var(--line); border-radius: 16px; }
.home-rafael-grid .home-inline-actions { justify-content: flex-start; margin: 1.2rem 0 0.7rem; }
.home-rafael-grid > div > small { color: var(--muted); }
.home-section-anchor { display: block; height: 0; scroll-margin-top: 5.5rem; }
.home-booking-guidance { max-width: 37rem; margin: 0.85rem 0 0; color: var(--gold); font-size: 0.94rem; line-height: 1.5; }

.pwa-install-panel .pwa-install-dodo { margin: -0.55rem -0.3rem -0.55rem -0.45rem; }

@media (max-width: 900px) {
    .home-hero-grid,
    .home-feature-split,
    .home-finance-card,
    .home-rafael-grid {
        grid-template-columns: 1fr;
    }

    .home-hero-grid { min-height: auto; }
    .home-demo-stage { width: min(38rem, 100%); min-height: 22rem; margin-inline: auto; }
    .home-finance-card { gap: 1.25rem; }
    .home-tools-panel { grid-template-columns: auto minmax(0, 1fr); }
    .home-tool-mini-list { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-teacher-cta { align-items: flex-start; flex-direction: column; }
    .home-teacher-cta .home-inline-actions { justify-content: flex-start; }
    .home-rafael-grid > img { max-height: 24rem; }
}

@media (min-width: 901px) {
    .home-demo-stage { min-height: clamp(27.5rem, 55vh, 31.5rem); }
}

@media (min-width: 901px) and (max-height: 820px) {
    .home-hero-grid { min-height: 34rem; padding-block: 1rem 1.35rem; }
    .home-hero-logo { width: 11rem; margin-bottom: -0.55rem; }
    .home-hero-copy .eyebrow { margin-bottom: 0.55rem; }
    .home-hero-copy h1 { max-width: 31rem; font-size: clamp(2.25rem, 3.5vw, 3rem); }
    .home-hero-copy > p:not(.eyebrow) { margin-top: 0.75rem; }
    .home-hero-actions { margin-top: 1rem; }
    .home-demo-stage { padding-top: 4.5rem; }
    .home-hero-dodo { --dodo-size: 11rem; }
}

@media (max-width: 620px) {
    .home-shell { width: min(100% - 1.25rem, 74rem); }
    .home-hero-grid { gap: 1rem; padding-block: 1rem 1.5rem; }
    .home-hero-logo { width: 10.75rem; margin-bottom: -0.45rem; }
    .home-hero-copy .eyebrow { margin-bottom: 0.55rem; }
    .home-hero-copy h1 { max-width: 22rem; font-size: clamp(2rem, 10vw, 2.65rem); }
    .home-hero-copy > p:not(.eyebrow) { margin-top: 0.75rem; font-size: 0.92rem; }
    .home-hero-actions { display: grid; gap: 0.5rem; margin-top: 1rem; }
    .home-hero-actions .button { width: 100%; min-height: 2.8rem; padding: 0.68rem 0.8rem; font-size: 0.83rem; }
    .home-demo-stage { min-height: 20rem; padding-top: 5rem; }
    .home-hero-dodo { top: -1.5rem; right: -0.5rem; width: 8rem; }
    .home-material-demo { padding: 0.9rem; border-radius: 12px; }
    .home-demo-heading { gap: 0.55rem; }
    .home-demo-note { width: 2.25rem; height: 2.25rem; font-size: 1.25rem; }
    .home-demo-heading h2 { font-size: 1.05rem; }
    .home-demo-heading p { font-size: 0.75rem; }
    .home-demo-resources { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .home-demo-resource { min-height: 2.4rem; padding: 0.45rem 0.55rem; font-size: 0.7rem; line-height: 1.2; }

    .home-audience,
    .home-section { padding-block: 2.25rem; }
    .home-path-grid,
    .home-teacher-grid { grid-template-columns: 1fr; }
    .home-path-card { padding: 1rem; }
    .home-section-heading h2,
    .home-section-copy h2,
    .home-tools-copy h2,
    .home-rafael-grid h2 { font-size: 1.85rem; }
    .home-feature-split { gap: 1.6rem; }
    .home-preview-row { padding: 0.68rem 0.75rem; }
    .home-preview-row strong { font-size: 0.82rem; }
    .home-preview-row small { font-size: 0.68rem; }
    .home-finance-preview { grid-template-columns: 1fr; }
    .home-finance-preview > div { border-right: 0; }
    .home-finance-preview p { font-size: 0.68rem; }
    .home-teacher-cta .home-inline-actions { display: grid; width: 100%; }
    .home-teacher-cta .button { width: 100%; }
    .home-tools-panel { grid-template-columns: 5rem minmax(0, 1fr); }
    .home-tools-dodo { width: 5.5rem; margin: 0; }
    .home-tools-copy .button { width: 100%; }
    .home-tool-mini-list { grid-template-columns: 1fr 1fr; }
    .home-install-panel { grid-template-columns: 4rem minmax(0, 1fr); padding: 0.8rem; }
    .home-install-panel .button { grid-column: 1 / -1; width: 100%; }
    .home-install-dodo { width: 4.5rem; margin-left: -0.45rem; }
    .home-rafael-grid { gap: 1.4rem; }
    .home-rafael-grid > img { max-height: 19rem; }
    .home-rafael-grid .home-inline-actions { display: grid; }
    .home-rafael-grid .button { width: 100%; }
    .pwa-install-panel { display: grid; grid-template-columns: 3rem minmax(0, 1fr); }
    .pwa-install-panel .pwa-panel-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .is-authenticated .whatsapp-float { bottom: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .home-path-card { transition: none; }
    .home-path-card:hover { transform: none; }
}

.tool-card-topline,
.tool-hero-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.8rem;
    align-items: center;
    justify-content: space-between;
}

.tool-hero-kicker {
    justify-content: flex-start;
    margin-bottom: 0.35rem;
}

.tool-hero-kicker .eyebrow {
    margin: 0;
}

.tuner-section {
    padding-bottom: 3rem;
}

.tuner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(18rem, 0.62fr);
    gap: 1.25rem;
}

.tuner-main-panel {
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem;
}

.tuner-heading {
    align-items: center;
}

.tuner-local-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--green) 10%, transparent);
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.tuner-display {
    --tuner-position: 50%;
    --tuner-state-color: var(--gold);
    display: grid;
    gap: 0.65rem;
    min-height: 25.5rem;
    align-content: center;
    border: 1px solid color-mix(in srgb, var(--tuner-state-color) 26%, var(--line));
    border-radius: 12px;
    padding: clamp(1.2rem, 4vw, 2.2rem);
    background:
        radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--tuner-state-color) 12%, transparent), transparent 13rem),
        color-mix(in srgb, var(--surface-strong) 64%, var(--surface));
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease;
}

.tuner-display[data-state="flat"] {
    --tuner-state-color: var(--blue);
}

.tuner-display[data-state="in-tune"] {
    --tuner-state-color: var(--green);
}

.tuner-display[data-state="sharp"] {
    --tuner-state-color: var(--rose);
}

.tuner-note-readout {
    display: flex;
    min-height: 7rem;
    align-items: baseline;
    justify-content: center;
    color: var(--tuner-state-color);
    line-height: 0.9;
    text-shadow: 0 0 2rem color-mix(in srgb, var(--tuner-state-color) 22%, transparent);
}

.tuner-note-readout strong {
    font-size: clamp(4.8rem, 12vw, 7.2rem);
    letter-spacing: -0.06em;
}

.tuner-note-readout span {
    margin-left: 0.28rem;
    color: color-mix(in srgb, var(--tuner-state-color) 78%, var(--text));
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
}

.tuner-frequency,
.tuner-cents,
.tuner-reference,
.tuner-status {
    margin: 0;
}

.tuner-frequency {
    color: var(--text);
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
}

.tuner-frequency small {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tuner-direction {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    width: min(30rem, 100%);
    margin: 0.3rem auto 0;
}

.tuner-direction span {
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.28rem 0.38rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tuner-direction span.is-active {
    border-color: color-mix(in srgb, var(--tuner-state-color) 42%, var(--line));
    background: color-mix(in srgb, var(--tuner-state-color) 12%, transparent);
    color: var(--tuner-state-color);
}

.tuner-meter {
    width: min(34rem, 100%);
    margin: 0.35rem auto 0;
    padding-top: 0.6rem;
}

.tuner-meter-track {
    position: relative;
    height: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--blue) 35%, var(--surface)) 0 44%, color-mix(in srgb, var(--green) 38%, var(--surface)) 44% 56%, color-mix(in srgb, var(--rose) 35%, var(--surface)) 56% 100%);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.34);
}

.tuner-in-tune-zone {
    position: absolute;
    inset: -0.28rem auto -0.28rem 50%;
    width: 12%;
    border-left: 1px solid color-mix(in srgb, var(--green) 54%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--green) 54%, transparent);
    transform: translateX(-50%);
}

.tuner-meter-needle {
    position: absolute;
    z-index: 2;
    left: var(--tuner-position);
    top: -0.65rem;
    width: 0.2rem;
    height: 1.9rem;
    border-radius: 999px;
    background: var(--tuner-state-color);
    box-shadow: 0 0 0.8rem color-mix(in srgb, var(--tuner-state-color) 60%, transparent);
    transform: translateX(-50%);
    transition: left 90ms linear, background 180ms ease;
}

.tuner-meter-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.48rem;
    color: var(--muted);
    font-size: 0.62rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.tuner-cents {
    color: var(--tuner-state-color);
    font-variant-numeric: tabular-nums;
}

.tuner-cents strong {
    font-size: 1.45rem;
}

.tuner-cents span,
.tuner-reference {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.tuner-controls {
    display: grid;
    grid-template-columns: minmax(12rem, auto) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
}

.tuner-start-button {
    min-width: 13.5rem;
}

.tuner-start-button[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--rose) 48%, var(--line));
    background: color-mix(in srgb, var(--rose) 18%, var(--surface));
    color: color-mix(in srgb, var(--rose) 84%, var(--text));
}

.tuner-microphone-icon {
    position: relative;
    display: inline-block;
    width: 0.9rem;
    height: 1.05rem;
    border: 2px solid currentColor;
    border-radius: 999px 999px 0.35rem 0.35rem;
}

.tuner-microphone-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.38rem;
    width: 0.55rem;
    height: 0.4rem;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    border-right: 2px solid currentColor;
    border-radius: 0 0 999px 999px;
    transform: translateX(-50%);
}

.tuner-status {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.tuner-status.is-error,
.tuner-message {
    color: color-mix(in srgb, var(--rose) 82%, var(--text));
}

.tuner-side-panel {
    display: grid;
    gap: 1rem;
    align-self: start;
}

.tuner-info-panel {
    gap: 0.75rem;
}

.tuner-info-panel h2 {
    margin: 0;
    font-size: 1.2rem;
}

.tuner-info-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.tuner-privacy-panel {
    border-color: color-mix(in srgb, var(--green) 32%, var(--line));
    background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

.tuner-step-list,
.tuner-tip-list {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tuner-step-list li {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.84rem;
}

.tuner-step-list li span {
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 50%;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 950;
}

.tuner-tip-list li {
    position: relative;
    padding-left: 1rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.tuner-tip-list li::before {
    content: "♪";
    position: absolute;
    left: 0;
    color: var(--gold);
}

@media (max-width: 900px) {
    .tuner-layout {
        grid-template-columns: 1fr;
    }

    .tuner-side-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .tuner-section {
        padding-inline: 0.25rem;
        padding-bottom: calc(5.4rem + env(safe-area-inset-bottom));
    }

    .tuner-main-panel {
        padding: 0.85rem;
    }

    .tuner-heading {
        align-items: start;
    }

    .tuner-display {
        min-height: 22rem;
        padding-inline: 0.85rem;
    }

    .tuner-note-readout {
        min-height: 5.8rem;
    }

    .tuner-controls,
    .tuner-side-panel {
        grid-template-columns: 1fr;
    }

    .tuner-start-button {
        width: 100%;
        min-width: 0;
    }
}

/* Dodo mascot system */
.dodo-mascot {
    --dodo-size: 7rem;
    position: relative;
    display: inline-grid;
    width: var(--dodo-size);
    max-width: 100%;
    flex: 0 0 auto;
    aspect-ratio: 1;
    place-items: center;
    isolation: isolate;
    animation: dodo-arrive 440ms cubic-bezier(.2, .8, .2, 1) both;
    pointer-events: none;
}

.dodo-mascot-tiny { --dodo-size: 3.25rem; }
.dodo-mascot-small { --dodo-size: 5.25rem; }
.dodo-mascot-medium { --dodo-size: 7rem; }
.dodo-mascot-large { --dodo-size: 9.5rem; }
.dodo-mascot-hero { --dodo-size: clamp(10rem, 20vw, 15rem); }

.dodo-mascot::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 20% 12% 8%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--gold) 18%, transparent), transparent 68%);
    filter: blur(8px);
    opacity: 0.72;
}

.dodo-mascot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0.75rem 1.15rem rgb(0 0 0 / 22%));
    transform-origin: 50% 78%;
    will-change: transform;
}

.dodo-motion-breathe img { animation: dodo-breathe 4.8s ease-in-out infinite; }
.dodo-motion-float img { animation: dodo-float 3.8s ease-in-out infinite; }
.dodo-motion-wave img { animation: dodo-wave 1.35s ease-in-out 3, dodo-breathe 4.8s ease-in-out 4.05s infinite; }
.dodo-motion-point img { animation: dodo-point 2.4s ease-in-out infinite; }
.dodo-motion-celebrate img { animation: dodo-celebrate 820ms cubic-bezier(.2, .75, .25, 1) 3; }
.dodo-motion-peek img { animation: dodo-peek 620ms cubic-bezier(.16, 1, .3, 1) both, dodo-breathe 4.8s ease-in-out 700ms infinite; }

.dodo-home-welcome {
    padding-block: 1.15rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.dodo-callout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(0.8rem, 3vw, 1.5rem);
    align-items: center;
    max-width: 50rem;
    padding: 0.7rem 1rem;
    border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 62%),
        var(--surface);
    overflow: hidden;
}

.dodo-callout h2 {
    margin-top: 0.2rem;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.dodo-callout p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.tools-hero .tools-hero-inner,
.teacher-dashboard-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tools-page .student-hero::after {
    display: none;
}

.tools-dodo {
    margin-block: -2.5rem -2rem;
}

.teacher-dashboard-dodo {
    margin-block: -2rem -1.4rem;
}

.dodo-empty-state {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.35rem 0.8rem;
    align-items: center;
}

.dodo-empty-state > .dodo-mascot {
    grid-row: 1 / span 3;
}

.dodo-empty-state > p,
.dodo-empty-state > strong,
.dodo-empty-state > .panel-label {
    grid-column: 2;
    margin-block: 0;
}

.teacher-list > .student-filter-empty,
.teacher-list.is-grid-view > .student-filter-empty {
    grid-column: 1 / -1;
    width: min(34rem, 100%);
    min-width: min(100%, 18rem);
    padding: 1rem 1.15rem;
}

.teacher-list > .student-filter-empty > p {
    max-width: 28rem;
    line-height: 1.45;
}

.student-study-empty {
    min-height: 5.5rem;
    padding: 0.65rem 0;
}

.daily-tip-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    width: min(22rem, calc(100vw - 2rem));
    padding-left: 0.65rem;
}

.daily-tip-card > div {
    display: grid;
    gap: 0.28rem;
}

.daily-tip-dodo {
    align-self: end;
    margin-bottom: -0.15rem;
}

.dodo-goal-celebration {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.45rem;
    color: var(--green);
    font-weight: 900;
}

.dodo-goal-celebration[hidden] {
    display: none;
}

.welcome-symbol-wrap {
    width: 9rem;
    overflow: visible;
    background: transparent;
}

.welcome-symbol-wrap .dodo-mascot {
    width: 9rem;
}

.welcome-symbol-wrap .dodo-mascot::after {
    opacity: 0.95;
}

.pwa-update-panel .pwa-update-dodo {
    margin: -0.5rem -0.35rem -0.45rem -0.35rem;
}

.pwa-release-panel {
    grid-template-columns: auto minmax(0, 1fr);
}

.pwa-release-dodo {
    align-self: start;
    margin: -0.35rem;
}

.pwa-release-actions {
    grid-column: 2;
}

.offline-card {
    text-align: center;
}

.offline-logo {
    display: block;
    margin-inline: auto;
}

.offline-dodo {
    display: grid;
    margin: -1.25rem auto -0.25rem;
}

.offline-actions {
    justify-content: center;
}

.error-shell {
    display: grid;
    min-height: calc(100svh - 5rem);
    place-items: center;
    padding: 1rem;
}

.error-card {
    display: grid;
    justify-items: center;
    width: min(34rem, 100%);
    gap: 0.75rem;
    padding: clamp(1.25rem, 5vw, 2rem);
    text-align: center;
}

.error-card h1 {
    font-size: clamp(1.8rem, 7vw, 2.7rem);
    text-transform: none;
}

.error-card p {
    max-width: 28rem;
    margin: 0;
    color: var(--muted);
}

@keyframes dodo-arrive {
    from { opacity: 0; transform: translateY(0.75rem) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dodo-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    48% { transform: translateY(-0.16rem) scale(1.018); }
}

@keyframes dodo-float {
    0%, 100% { transform: translateY(0) rotate(-0.6deg); }
    50% { transform: translateY(-0.38rem) rotate(0.8deg); }
}

@keyframes dodo-wave {
    0%, 100% { transform: rotate(0) translateY(0); }
    30% { transform: rotate(-2.3deg) translateY(-0.18rem); }
    62% { transform: rotate(1.7deg) translateY(-0.06rem); }
}

@keyframes dodo-point {
    0%, 100% { transform: translateX(0) rotate(0); }
    45% { transform: translateX(0.32rem) rotate(0.8deg); }
    70% { transform: translateX(0.12rem) rotate(-0.35deg); }
}

@keyframes dodo-celebrate {
    0%, 100% { transform: translateY(0) rotate(0) scale(1); }
    36% { transform: translateY(-0.55rem) rotate(-2deg) scale(1.035); }
    68% { transform: translateY(-0.12rem) rotate(2deg) scale(1.018); }
}

@keyframes dodo-peek {
    from { opacity: 0; transform: translateX(1.2rem) rotate(4deg) scale(0.9); }
    to { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

@media (max-width: 620px) {
    .dodo-mascot-large { --dodo-size: 7.25rem; }
    .dodo-mascot-hero { --dodo-size: 8.25rem; }

    .dodo-callout {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        padding: 0.5rem 0.7rem;
    }

    .dodo-callout .dodo-mascot {
        width: 5.8rem;
        margin-left: -0.45rem;
    }

    .dodo-callout p {
        font-size: 0.85rem;
    }

    .tools-dodo {
        margin: -1.6rem -0.7rem -1.25rem 0;
    }

    .teacher-dashboard-dodo {
        width: 6.5rem;
        margin: -1.5rem -0.45rem -1rem 0;
    }

    .teacher-dashboard-hero-inner p {
        max-width: 16rem;
    }

    .daily-tip-card {
        grid-template-columns: 3rem minmax(0, 1fr);
    }

    .pwa-release-panel {
        grid-template-columns: 3.75rem minmax(0, 1fr);
    }

    .pwa-release-actions {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dodo-mascot,
    .dodo-mascot img,
    .welcome-symbol-wrap,
    .welcome-symbol-wrap::before,
    .welcome-symbol-wrap::after {
        animation: none !important;
        transform: none !important;
    }
}

.keyboard-section {
    padding-top: 0;
}

.keyboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem);
    gap: 1rem;
    align-items: start;
}

.keyboard-panel,
.keyboard-guide {
    min-width: 0;
}

.keyboard-panel {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    overflow: hidden;
}

.keyboard-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.keyboard-heading h2,
.keyboard-guide h2 {
    margin: 0.35rem 0 0;
}

.keyboard-heading p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.keyboard-note-readout {
    display: grid;
    flex: 0 0 auto;
    min-width: 7.5rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--line));
    border-radius: 0.8rem;
    text-align: right;
    background: color-mix(in srgb, var(--gold) 9%, var(--surface-strong));
}

.keyboard-note-readout span {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 850;
}

.keyboard-note-readout small {
    margin-top: 0.1rem;
    color: var(--muted);
}

.keyboard-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
    margin: 1.15rem 0 0.9rem;
}

.keyboard-mode-control {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 3.25rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--surface-strong);
}

.keyboard-mode-control button {
    min-width: 5.2rem;
    border: 0;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    background: transparent;
    cursor: pointer;
}

.keyboard-mode-control button + button {
    border-left: 1px solid var(--line);
}

.keyboard-mode-control button:hover,
.keyboard-mode-control button.is-active {
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 12%, var(--surface));
}

.keyboard-mode-control button:focus-visible {
    position: relative;
    z-index: 2;
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}

.keyboard-octave-control {
    display: grid;
    grid-template-columns: 2.65rem minmax(8.2rem, auto) 2.65rem;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--surface-strong);
}

.keyboard-octave-control > div {
    display: grid;
    place-content: center;
    padding: 0.35rem 0.7rem;
    text-align: center;
}

.keyboard-octave-control small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.keyboard-octave-control strong {
    margin-top: 0.08rem;
    font-size: 0.88rem;
}

.keyboard-step-button {
    border: 0;
    color: var(--text);
    font: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    cursor: pointer;
}

.keyboard-step-button:first-child {
    border-right: 1px solid var(--line);
}

.keyboard-step-button:last-child {
    border-left: 1px solid var(--line);
}

.keyboard-step-button:hover:not(:disabled) {
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 12%, var(--surface));
}

.keyboard-step-button:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.42;
}

.keyboard-volume-control,
.keyboard-sustain-control {
    min-height: 3.25rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--surface-strong);
}

.keyboard-volume-control {
    display: grid;
    flex: 1 1 10rem;
    gap: 0.25rem;
    padding: 0.45rem 0.75rem;
}

.keyboard-volume-control span,
.keyboard-sustain-control span {
    font-size: 0.76rem;
    font-weight: 800;
}

.keyboard-volume-control input {
    width: 100%;
    accent-color: var(--gold);
}

.keyboard-sustain-control {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}

.keyboard-sustain-control input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--green);
}

.keyboard-stop-button {
    min-height: 3.25rem;
    padding-inline: 0.9rem;
}

.keyboard-instrument-shell {
    position: relative;
    overflow: hidden;
    padding: 0.58rem 0.58rem 0.68rem;
    border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
    border-radius: 1rem;
    background:
        radial-gradient(circle at 50% -30%, rgba(244, 179, 33, 0.16), transparent 55%),
        #08090b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1rem 2.5rem rgba(0, 0, 0, 0.2);
}

.keyboard-felt {
    height: 0.42rem;
    border-radius: 0.42rem 0.42rem 0 0;
    background: linear-gradient(180deg, #b71d30, #680711);
    box-shadow: 0 0.18rem 0.6rem rgba(183, 29, 48, 0.2);
}

.keyboard-instrument {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(13rem, 31vw, 19rem);
    min-height: 13rem;
    isolation: isolate;
    touch-action: none;
    user-select: none;
}

.keyboard-register {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    isolation: isolate;
}

.keyboard-register-secondary {
    display: none;
}

.is-two-octaves .keyboard-instrument {
    display: grid;
    grid-template-columns: 7fr 8fr;
}

.is-two-octaves .keyboard-register-secondary {
    display: flex;
}

.is-two-octaves .keyboard-register-primary .keyboard-terminal-key {
    display: none;
}

.is-two-octaves .keyboard-register-primary .keyboard-key-black {
    left: var(--key-left-double);
    width: 8.8%;
}

.is-two-octaves .keyboard-register-primary .keyboard-key-white:nth-of-type(7) {
    border-right: 0;
    border-radius: 0 0 0.45rem 0.45rem;
}

.is-two-octaves .keyboard-register-secondary .keyboard-key-white:first-child {
    border-radius: 0 0 0.45rem 0.45rem;
}

.keyboard-key {
    position: relative;
    border: 0;
    border-radius: 0 0 0.45rem 0.45rem;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 70ms ease, background 90ms ease, box-shadow 90ms ease;
}

.keyboard-key-white {
    display: flex;
    z-index: 1;
    flex: 1 1 12.5%;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    padding: 0.8rem 0.15rem;
    border-right: 1px solid #9aa2ad;
    color: #22262c;
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 62%, #dce3ec 100%);
    box-shadow: inset 0 -0.55rem 0.85rem rgba(61, 71, 84, 0.14);
}

.keyboard-key-white:first-child {
    border-radius: 0 0 0.45rem 0.65rem;
}

.keyboard-key-white:nth-of-type(8) {
    border-right: 0;
    border-radius: 0 0 0.65rem 0.45rem;
}

.keyboard-key-black {
    position: absolute;
    z-index: 3;
    top: 0;
    left: var(--key-left);
    display: flex;
    width: 7.8%;
    height: 62%;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    justify-content: flex-end;
    padding: 0.65rem 0.1rem;
    color: #f8f9fb;
    background: linear-gradient(90deg, #090a0c, #262a31 48%, #07080a);
    box-shadow: inset 0 -0.45rem 0.8rem rgba(255, 255, 255, 0.07), 0 0.4rem 0.55rem rgba(0, 0, 0, 0.42);
    transform: translateX(-50%);
}

.keyboard-key span {
    font-size: clamp(0.72rem, 1.45vw, 0.95rem);
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.keyboard-key kbd {
    display: inline-grid;
    min-width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 0.35rem;
    color: inherit;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 850;
    opacity: 0.58;
    background: transparent;
    box-shadow: none;
}

.keyboard-key[data-note="0"],
.keyboard-key[data-note="12"],
.keyboard-key[data-note="24"] { --note-color: #f4b321; }
.keyboard-key[data-note="1"],
.keyboard-key[data-note="2"],
.keyboard-key[data-note="13"],
.keyboard-key[data-note="14"] { --note-color: #40d1b1; }
.keyboard-key[data-note="3"],
.keyboard-key[data-note="4"],
.keyboard-key[data-note="15"],
.keyboard-key[data-note="16"] { --note-color: #71b8ff; }
.keyboard-key[data-note="5"],
.keyboard-key[data-note="6"],
.keyboard-key[data-note="17"],
.keyboard-key[data-note="18"] { --note-color: #ff7a9a; }
.keyboard-key[data-note="7"],
.keyboard-key[data-note="8"],
.keyboard-key[data-note="19"],
.keyboard-key[data-note="20"] { --note-color: #ffca3d; }
.keyboard-key[data-note="9"],
.keyboard-key[data-note="10"],
.keyboard-key[data-note="21"],
.keyboard-key[data-note="22"] { --note-color: #39a6b7; }
.keyboard-key[data-note="11"],
.keyboard-key[data-note="23"] { --note-color: #40d1b1; }

.keyboard-key-white.is-active {
    color: #14171b;
    background: linear-gradient(180deg, color-mix(in srgb, var(--note-color) 62%, #fff), color-mix(in srgb, var(--note-color) 26%, #e5e9ef));
    box-shadow: inset 0 0 1.8rem color-mix(in srgb, var(--note-color) 46%, transparent);
    transform: translateY(0.22rem);
}

.keyboard-key-black.is-active {
    color: #fff;
    background: linear-gradient(180deg, color-mix(in srgb, var(--note-color) 70%, #1d2025), color-mix(in srgb, var(--note-color) 30%, #08090b));
    box-shadow: 0 0 1.25rem color-mix(in srgb, var(--note-color) 48%, transparent);
    transform: translate(-50%, 0.16rem);
}

.keyboard-key:focus-visible,
.keyboard-step-button:focus-visible {
    z-index: 5;
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}

.keyboard-help {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    text-align: center;
}

.keyboard-guide {
    padding: 1.2rem;
}

.keyboard-guide ol {
    display: grid;
    gap: 0.85rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
    counter-reset: keyboard-guide;
}

.keyboard-guide li {
    position: relative;
    display: grid;
    gap: 0.16rem;
    min-height: 2.4rem;
    padding-left: 2.8rem;
    counter-increment: keyboard-guide;
}

.keyboard-guide li::before {
    content: counter(keyboard-guide);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
    border-radius: 50%;
    color: var(--gold);
    font-weight: 850;
    background: color-mix(in srgb, var(--gold) 9%, transparent);
}

.keyboard-guide li span,
.keyboard-guide > p {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.keyboard-guide > p {
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
    .keyboard-layout {
        grid-template-columns: 1fr;
    }

    .keyboard-guide {
        display: none;
    }
}

@media (max-width: 560px) {
    .keyboard-panel {
        padding: 0.8rem;
    }

    .keyboard-heading {
        display: grid;
        gap: 0.7rem;
    }

    .keyboard-heading p {
        display: none;
    }

    .keyboard-heading h2 {
        max-width: 18rem;
        font-size: clamp(1.7rem, 8vw, 2.2rem);
        line-height: 1.04;
    }

    .keyboard-note-readout {
        grid-template-columns: auto 1fr;
        gap: 0.6rem;
        align-items: baseline;
        width: 100%;
        min-width: 0;
        padding: 0.55rem 0.65rem;
        text-align: left;
    }

    .keyboard-note-readout small {
        margin: 0;
        text-align: right;
    }

    .keyboard-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.55rem;
        margin-top: 0.85rem;
    }

    .keyboard-octave-control,
    .keyboard-mode-control,
    .keyboard-volume-control {
        grid-column: 1 / -1;
    }

    .keyboard-mode-control {
        width: 100%;
        min-height: 2.9rem;
    }

    .keyboard-sustain-control,
    .keyboard-stop-button {
        width: 100%;
        min-width: 0;
        min-height: 2.8rem;
        justify-content: center;
        padding-inline: 0.5rem;
    }

    .keyboard-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .keyboard-instrument-shell {
        margin-inline: -0.2rem;
        padding: 0.4rem 0.3rem 0.45rem;
        border-radius: 0.75rem;
    }

    .keyboard-felt {
        height: 0.32rem;
    }

    .keyboard-instrument {
        height: clamp(12.5rem, 62vw, 15rem);
        min-height: 12.5rem;
    }

    .is-two-octaves .keyboard-instrument {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        height: clamp(25rem, 124vw, 30rem);
        min-height: 25rem;
    }

    .is-two-octaves .keyboard-register-primary .keyboard-terminal-key {
        display: flex;
    }

    .is-two-octaves .keyboard-register-primary .keyboard-key-black {
        left: var(--key-left);
        width: 8.8%;
    }

    .is-two-octaves .keyboard-register-primary .keyboard-key-white:nth-of-type(7) {
        border-right: 1px solid #9aa2ad;
        border-radius: 0 0 0.45rem 0.45rem;
    }

    .is-two-octaves .keyboard-register-primary .keyboard-key-white:nth-of-type(8) {
        border-right: 0;
        border-radius: 0 0 0.65rem 0.45rem;
    }

    .is-two-octaves .keyboard-register-secondary {
        border-top: 0.32rem solid #7f0d1b;
    }

    .keyboard-key-white {
        padding: 0.65rem 0.05rem;
    }

    .keyboard-key-black {
        width: 8.8%;
        height: 60%;
        padding: 0.55rem 0.02rem;
    }

    .keyboard-key span {
        font-size: 0.7rem;
    }

    .keyboard-key kbd {
        min-width: 1.25rem;
        height: 1.25rem;
        font-size: 0.6rem;
    }

    .keyboard-help {
        font-size: 0.76rem;
        line-height: 1.4;
    }
}

.locked-feature-panel {
    border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    border-radius: 0.85rem;
    padding: 1rem;
    background: color-mix(in srgb, var(--gold) 10%, var(--panel));
}

.locked-feature-panel strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--gold);
}

.locked-feature-panel p {
    margin: 0;
    color: var(--muted);
}

.message-rich {
    display: grid;
    gap: 0.65rem;
    line-height: 1.55;
}

.embed-box {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: #050607;
}

.youtube-embed {
    aspect-ratio: 16 / 9;
    max-width: 44rem;
}

.youtube-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.inline-image-link {
    display: block;
    width: min(100%, 34rem);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--panel) 90%, #000);
}

.inline-image-link img {
    display: block;
    width: 100%;
    height: auto;
}

.inline-video {
    display: block;
    width: min(100%, 34rem);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: #050607;
}

.account-form[data-drop-file] {
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.account-form[data-drop-file].is-dragging-file {
    border-color: color-mix(in srgb, var(--teal) 72%, var(--line));
    background: color-mix(in srgb, var(--teal) 10%, var(--panel));
    box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--teal) 14%, transparent);
}

.drop-file-status {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
}

@keyframes metronome-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.98);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 28%, transparent);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0.8rem color-mix(in srgb, var(--gold) 0%, transparent);
    }
}

@keyframes metronome-number-tick {
    0% {
        transform: scale(0.92);
        filter: drop-shadow(0 0 0 color-mix(in srgb, var(--gold) 0%, transparent));
    }
    70% {
        transform: scale(1.06);
        filter: drop-shadow(0 0 0.7rem color-mix(in srgb, var(--gold) 38%, transparent));
    }
    100% {
        transform: scale(1);
        filter: none;
    }
}

@keyframes mechanical-swing {
    0%, 50%, 100% {
        transform: translateX(-50%) rotate(0deg);
    }
    12.5% {
        transform: translateX(-50%) rotate(17deg);
    }
    25% {
        transform: translateX(-50%) rotate(25deg);
    }
    37.5% {
        transform: translateX(-50%) rotate(17deg);
    }
    62.5% {
        transform: translateX(-50%) rotate(-17deg);
    }
    75% {
        transform: translateX(-50%) rotate(-25deg);
    }
    87.5% {
        transform: translateX(-50%) rotate(-17deg);
    }
}

@keyframes compound-unit-pulse {
    0% {
        transform: scale(0.94);
        filter: drop-shadow(0 0 0 color-mix(in srgb, var(--green) 0%, transparent));
    }
    70% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 0.55rem color-mix(in srgb, var(--green) 42%, transparent));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 color-mix(in srgb, var(--green) 0%, transparent));
    }
}

@keyframes metronome-figure-glow {
    0% {
        transform: scale(0.96);
        filter: drop-shadow(0 0 0 color-mix(in srgb, var(--gold) 0%, transparent));
    }
    62% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 0.72rem color-mix(in srgb, var(--gold) 52%, transparent));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 color-mix(in srgb, var(--gold) 0%, transparent));
    }
}

@keyframes metronome-beat-glow {
    0% {
        transform: scale(0.82);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent);
    }
    66% {
        transform: scale(1.2);
        box-shadow: 0 0 1rem color-mix(in srgb, var(--gold) 58%, transparent);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent);
    }
}

@keyframes metronome-dot-glow {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent);
    }
    70% {
        box-shadow: 0 0 0 0.32rem color-mix(in srgb, var(--gold) 16%, transparent);
    }
    100% {
        box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--gold) 10%, transparent);
    }
}

/* Keep the main controls on a full-width row before the two-column layout
   becomes too narrow on landscape tablets and installed-app viewports. */
@media (max-width: 1120px) {
    .metronome-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .metronome-section {
        padding-inline: 0.25rem;
        padding-bottom: calc(5.4rem + env(safe-area-inset-bottom));
    }

    .metronome-heading {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        align-items: stretch;
    }

    .metronome-click-unit-top {
        justify-self: start;
        margin-top: 0;
    }

    .metronome-andamento-core {
        width: 100%;
    }

    .metronome-bpm-strip {
        gap: 0.32rem;
    }

    .metronome-bpm-readout {
        min-width: 7.5rem;
    }

    .metronome-play-button {
        width: 100%;
        margin-top: 0;
        justify-self: stretch;
    }

    .metronome-stage {
        min-height: 15.4rem;
    }

    .metronome-stage::before {
        bottom: 0.62rem;
        left: 0.75rem;
        right: 0.75rem;
    }

    .metronome-gradient-line {
        left: 0.75rem;
        right: 0.75rem;
    }

    .metronome-meter-label {
        bottom: 1.1rem;
    }

    .metronome-orbit {
        width: min(10.5rem, 58vw);
    }

    .metronome-view-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.22rem;
        max-width: none;
    }

    .metronome-view-tabs button {
        grid-template-rows: 1.32rem auto;
        min-height: 2.76rem;
        padding: 0.3rem 0.12rem 0.26rem;
    }

    .metronome-view-icon {
        transform: scale(0.9);
    }

    .metronome-view-label {
        font-size: 0.48rem;
    }

    .mechanical-metronome {
        height: 12.5rem;
        transform: scale(0.88);
    }

    .metronome-dot {
        width: 2.75rem;
        height: 2.75rem;
    }

    .metronome-visual {
        padding-inline: 0.35rem;
    }

    .metronome-dot-grid,
    .metronome-figure-grid {
        gap: 0.28rem;
        width: 100%;
    }

    .metronome-figure-grid {
        grid-template-columns: repeat(auto-fit, minmax(4.05rem, 4.8rem));
        justify-content: center;
    }

    .metronome-figure-beat {
        min-width: 0;
        min-height: 5.05rem;
        padding-inline: 0.06rem;
    }

    .metronome-figure-beat .rhythm-figure {
        width: 1.76rem;
        height: 2.42rem;
    }

    .metronome-figure-beat .rhythm-figure-smufl {
        font-size: 2.25rem;
    }

    .metronome-figure-beat strong {
        font-size: 0.84rem;
    }

    .figure-subdivision-preview .subdivision-vex {
        width: min(4.65rem, 100%);
    }

    .metronome-bpm-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .metronome-bpm-field {
        justify-self: start;
    }

    .metronome-step-group {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }

    .metronome-step-button {
        min-width: 2.25rem;
        min-height: 2.08rem;
    }

    .metronome-tap-button {
        flex: 0 0 100%;
        width: 100%;
        justify-self: stretch;
    }

    .metronome-tap-status {
        flex-basis: 100%;
        max-width: none;
    }

    .metronome-beats-shell {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .metronome-subdivision-header {
        align-items: stretch;
    }

    .metronome-subdivision-actions {
        width: 100%;
        justify-content: stretch;
    }

    .subdivision-open-button,
    .subdivision-clear-button-inline {
        flex: 1 1 8.5rem;
    }

    .metronome-beat-grid {
        grid-column: 1;
    }

    .meter-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-meter-panel {
        grid-template-columns: 1fr;
    }

    .rhythm-note-grid {
        grid-template-columns: repeat(5, minmax(3.4rem, 1fr));
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }

    .subdivision-option-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.24rem;
    }

    .subdivision-option-grid button {
        min-height: 3.9rem;
        overflow: hidden;
    }

    .subdivision-option-grid .subdivision-vex,
    .subdivision-option-grid .subdivision-vex[data-vex-subdivision="semi-pontuada"] {
        width: min(5.1rem, 100%);
        height: 3.15rem;
        transform: none;
    }

    .subdivision-option-grid .subdivision-vex.has-tuplet svg {
        transform: translateY(-0.28rem);
    }

    .is-compound-meter .metronome-figure-grid {
        grid-template-columns: repeat(var(--compound-group-count, 2), minmax(0, 1fr));
        gap: 0.12rem;
    }

    .metronome-figure-group {
        width: 100%;
        gap: 0.2rem;
    }

    .compound-figure-row {
        gap: 0.02rem;
    }

    .is-compound-meter[data-compound-groups="4"] .compound-time-unit {
        min-height: 2.8rem;
        gap: 0.12rem;
    }

    .is-compound-meter[data-compound-groups="4"] .compound-time-unit .rhythm-figure {
        width: 0.95rem;
        height: 1.28rem;
    }

    .is-compound-meter[data-compound-groups="4"] .compound-time-unit .rhythm-figure-smufl {
        font-size: 1.18rem;
    }

    .is-compound-meter[data-compound-groups="4"] .metronome-figure-beat {
        padding-inline: 0;
    }

    .is-compound-meter[data-compound-groups="4"] .metronome-figure-beat .rhythm-figure {
        width: 1.3rem;
        height: 2rem;
    }

    .is-compound-meter[data-compound-groups="4"] .metronome-figure-beat .rhythm-figure-smufl {
        font-size: 1.72rem;
    }
}

@media (max-width: 900px) {
    .student-page .student-layout {
        grid-template-columns: 1fr;
    }

    .student-page .student-calendar-card,
    .student-side-stack {
        grid-column: 1;
    }
}

.weekly-note-box {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.weekly-note-box p {
    margin: 0;
    color: var(--muted);
}

.study-area-list {
    display: grid;
    gap: 0.42rem;
}

.study-area-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    overflow: hidden;
    transition: border-color 160ms ease, background 160ms ease;
}

.study-area-card:hover {
    border-color: color-mix(in srgb, var(--gold) 28%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 76%, var(--surface));
}

.study-area-card > summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    cursor: pointer;
    padding: 0.48rem 0.68rem;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0;
    list-style: none;
    text-transform: uppercase;
}

.study-area-card > summary::-webkit-details-marker,
.study-item-card > summary::-webkit-details-marker {
    display: none;
}

.study-area-card > summary::before {
    content: "\266B";
    display: inline-grid;
    width: 1.18rem;
    height: 1.18rem;
    flex: 0 0 1.18rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.82rem;
    line-height: 1;
}

.study-area-card.area-method > summary::before {
    content: "\1F4D8";
    color: #7cb7ff;
    background: color-mix(in srgb, #2f86ff 18%, transparent);
}

.study-area-card.area-repertoire > summary::before {
    content: "\266B";
    color: #ff7aa9;
    background: color-mix(in srgb, #ff7aa9 18%, transparent);
}

.study-area-card.area-technique > summary::before {
    content: "\266C";
    color: var(--green);
    background: color-mix(in srgb, var(--green) 16%, transparent);
}

.study-area-card.area-theory > summary::before {
    content: "\1D11E";
    color: #9fc7ff;
    background: color-mix(in srgb, #7cb7ff 16%, transparent);
}

.study-area-card > summary span {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: lowercase;
}

.study-area-card > summary::after,
.study-item-card > summary::after,
.submission-card > summary::after {
    content: "v";
    display: inline-grid;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 1.25rem;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
}

.study-area-card[open] > summary::after,
.study-item-card[open] > summary::after,
.submission-card[open] > summary::after {
    content: "^";
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.study-item-card {
    border-top: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg) 34%, transparent);
    transition: background 160ms ease;
}

.study-item-card:hover {
    background: color-mix(in srgb, var(--gold) 5%, var(--bg));
}

.study-item-card > summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    min-height: 2.65rem;
    padding: 0.48rem 0.68rem;
    cursor: pointer;
    list-style: none;
}

.study-item-card > summary::before {
    content: "\266A";
    display: inline-grid;
    width: 1.18rem;
    height: 1.18rem;
    flex: 0 0 1.18rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 14%, transparent);
    color: var(--gold);
    font-size: 0.78rem;
}

.study-item-card > summary > span:first-of-type {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.study-item-card > summary::after {
    order: 3;
    margin-left: 0.1rem;
}

.study-item-card > summary .status-chip {
    order: 4;
}

.study-item-card > summary .summary-progress {
    order: 5;
}

.study-item-card > summary strong,
.study-item-card > summary small {
    display: block;
}

.study-item-card > summary small {
    margin-top: 0.08rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.study-topic-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.22rem;
    margin-top: 0.26rem;
    max-width: 100%;
}

.study-topic-pill {
    display: inline-flex;
    align-items: center;
    max-width: 14rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
    border-radius: 999px;
    padding: 0.08rem 0.36rem;
    color: color-mix(in srgb, var(--green) 78%, var(--text));
    background: color-mix(in srgb, var(--green) 7%, transparent);
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.required-mark {
    color: var(--gold);
    font-weight: 900;
}

.study-item-card[open] > summary {
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.study-item-card.is-completed {
    opacity: 0.92;
}

.study-item-body {
    display: grid;
    gap: 0.58rem;
    padding: 0.62rem 0.78rem 0.78rem 2.45rem;
}

.study-item-body p {
    margin: 0;
}

.study-item-body .resource-link {
    width: fit-content;
    margin-top: 0.1rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.35rem;
    border: 1px solid color-mix(in srgb, var(--gold) 54%, var(--line));
    border-radius: 999px;
    padding: 0.14rem 0.42rem;
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-chip.muted {
    border-color: var(--line);
    color: var(--muted);
}

.status-chip.done {
    border-color: color-mix(in srgb, var(--green) 55%, var(--line));
    color: var(--green);
}

.summary-progress {
    display: grid;
    gap: 0.18rem;
    width: min(9rem, 20vw);
    min-width: 5.4rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-align: right;
}

.summary-progress .duo-progress {
    height: 0.42rem;
}

.summary-progress .duo-progress i {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--green));
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18);
}

.summary-progress .progress-level-1 i {
    background: linear-gradient(90deg, #ff8a8a, #e45050);
}

.summary-progress .progress-level-2 i {
    background: linear-gradient(90deg, #ffd36a, #f4b321);
}

.summary-progress .progress-level-3 i {
    background: linear-gradient(90deg, #65d6c2, #27a892);
}

.summary-progress .progress-level-4 i {
    background: linear-gradient(90deg, #58e89b, #20b875);
}

.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    width: fit-content;
    max-width: min(100%, 22rem);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.34rem 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 800;
}

.resource-link .resource-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.submissions-layout {
    display: grid;
    gap: 1.25rem;
    width: min(980px, 100%);
    margin-inline: auto;
}

.submission-compose-panel {
    gap: 1rem;
}

.submission-form {
    display: grid;
    gap: 0.95rem;
}

.submission-form .button {
    justify-self: start;
}

.submission-form .field-grid {
    gap: 0.9rem;
}

.submission-list {
    display: grid;
    gap: 0.7rem;
}

.submission-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.submission-card > summary {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    list-style: none;
}

.submission-card > summary::-webkit-details-marker {
    display: none;
}

.submission-card > summary::before {
    content: "";
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 1.1rem;
    border: 1.7px solid var(--gold);
    border-radius: 4px;
    box-shadow: inset 0 -0.28rem 0 color-mix(in srgb, var(--gold) 12%, transparent);
}

.submission-card-main {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
    margin-right: auto;
}

.submission-card-main small {
    color: var(--muted);
}

.submission-body {
    display: grid;
    gap: 0.75rem;
    padding: 0 0.85rem 0.9rem 3rem;
}

.submission-body p {
    margin: 0;
}

.response-thread {
    display: grid;
    gap: 0.55rem;
}

.response-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.7rem;
    border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--green) 8%, transparent);
}

.submission-response-form {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.2rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.student-calendar-page {
    display: grid;
    grid-template-columns: minmax(0, 980px);
    gap: 1.05rem;
    align-items: start;
    justify-content: center;
    width: min(1080px, calc(100% - 2rem));
    margin-inline: auto;
}

.student-materials-page {
    display: grid;
    grid-template-columns: minmax(320px, 660px) minmax(260px, 340px);
    gap: 1.1rem;
    align-items: start;
    justify-content: center;
    width: min(1080px, calc(100% - 2rem));
    margin-inline: auto;
}

.student-calendar-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.05rem;
    align-items: stretch;
}

.student-calendar-action-grid > .inline-details:not([open]) {
    min-height: 8rem;
}

.student-calendar-action-grid > .inline-details:not([open]) > summary {
    display: flex;
    min-height: 8rem;
    align-items: center;
}

.student-calendar-main-card {
    width: 100%;
}

.student-calendar-main-card,
.student-page .student-calendar-main-card {
    width: min(720px, 100%);
    justify-self: center;
}

.student-policy-page {
    width: min(900px, calc(100% - 2rem));
    margin-inline: auto;
}

.policy-stack {
    display: grid;
    gap: 0.85rem;
}

.policy-card summary {
    align-items: center;
}

.policy-body {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.8rem;
    color: var(--text);
}

.policy-body p {
    margin: 0;
    color: var(--muted);
}

.student-calendar-side {
    display: grid;
    gap: 0.8rem;
}

.reschedule-request-form {
    gap: 0.85rem;
}

.lesson-choice-list {
    display: grid;
    gap: 0.42rem;
}

.lesson-choice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    cursor: pointer;
}

.student-calendar-page .inline-details > summary {
    min-height: 3rem;
}

.student-calendar-page .inline-details > p,
.student-calendar-page .inline-details > form,
.student-calendar-page .inline-details > .submission-list {
    margin-top: 0.75rem;
}

.lesson-choice:hover {
    border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
    background: color-mix(in srgb, var(--gold) 6%, var(--surface));
}

.lesson-choice.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lesson-choice span {
    display: grid;
    gap: 0.08rem;
}

.lesson-choice small {
    color: var(--muted);
}

.material-library-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.65rem;
}

.material-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.material-filter-bar button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.material-filter-bar button:hover,
.material-filter-bar button.is-active {
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
    background: color-mix(in srgb, var(--gold) 14%, var(--surface));
    color: var(--text);
}

.material-library-card {
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    gap: 0.7rem;
    align-items: center;
    min-height: 4.2rem;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    color: var(--text);
    text-decoration: none;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.material-library-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--gold) 38%, var(--line));
    background: color-mix(in srgb, var(--gold) 7%, var(--surface));
}

.material-resource-icon {
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold);
    font-weight: 900;
}

.material-library-card strong,
.material-library-card small {
    display: block;
}

.material-library-card small {
    color: var(--muted);
}

.calendar-guide-card .guide-list,
.reschedule-inline-form {
    gap: 0.65rem;
}

.reschedule-request-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.reschedule-request-card {
    display: grid;
    grid-template-columns: minmax(13rem, 0.75fr) minmax(22rem, 1.5fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.reschedule-request-summary {
    display: grid;
    gap: 0.35rem;
    align-content: start;
    min-width: 0;
}

.reschedule-request-summary > span {
    color: var(--muted);
    line-height: 1.45;
}

.reschedule-request-card .reschedule-inline-form {
    padding: 0;
    min-width: 0;
}

.reschedule-request-card .teacher-actions {
    justify-content: flex-start;
}

.lesson-status-actions {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

@media (max-width: 900px) {
    .student-calendar-page,
    .student-materials-page {
        grid-template-columns: 1fr;
    }

    .student-calendar-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .student-calendar-page,
    .student-materials-page {
        width: calc(100% - 1rem);
        gap: 0.85rem;
        padding-bottom: calc(5.4rem + env(safe-area-inset-bottom));
    }

    .student-calendar-action-grid,
    .student-calendar-side {
        gap: 0.85rem;
    }

    .student-calendar-page .inline-details > summary {
        min-height: 3.2rem;
    }

    .student-calendar-main-card,
    .student-page .student-calendar-main-card,
    .student-page .student-calendar-card {
        width: 100%;
        max-width: 100%;
    }
}

.submission-inline-action {
    margin: 0.15rem 0 0;
}

.submission-status-aberto {
    border-color: color-mix(in srgb, var(--gold) 52%, var(--line));
    color: var(--gold);
}

.submission-status-respondido {
    border-color: color-mix(in srgb, var(--green) 52%, var(--line));
    color: var(--green);
}

.submission-status-arquivado {
    border-color: var(--line);
    color: var(--muted);
}

.student-submission-card {
    text-decoration: none;
}

.student-submission-card strong {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
}

.teacher-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.teacher-hero-stats span {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    min-height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    padding: 0.35rem 0.6rem;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    color: var(--muted);
    font-weight: 700;
}

.teacher-hero-stats strong {
    color: var(--text);
}

.resource-link:hover {
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
    color: var(--gold);
}

.settings-panel h2 {
    margin: 0;
    font-size: 1.2rem;
}

.settings-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    cursor: pointer;
}

.settings-row input {
    margin-top: 0.25rem;
    accent-color: var(--gold);
}

.settings-row strong,
.settings-row small {
    display: block;
}

.settings-row small {
    color: var(--muted);
}

.profile-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.account-link-list {
    display: grid;
    gap: 0.7rem;
}

.account-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.account-link-row strong,
.account-link-row small {
    display: block;
}

.account-link-row small {
    color: var(--muted);
}

.account-link-row form {
    margin: 0;
}

.button:disabled,
.button[disabled] {
    cursor: not-allowed;
    opacity: 0.46;
    transform: none;
}

.danger-zone-panel {
    border-color: color-mix(in srgb, #ff6767 36%, var(--line));
    background:
        linear-gradient(135deg, color-mix(in srgb, #ff3434 8%, var(--surface-strong)), color-mix(in srgb, var(--surface) 92%, transparent));
}

.danger-check-row {
    border-color: color-mix(in srgb, #ff6767 26%, var(--line));
}

@media (max-width: 759px) {
    .account-link-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .account-link-row .button {
        width: 100%;
    }
}

.resource-link.drive {
    color: #8ed7ff;
}

.resource-link.youtube {
    color: #ff8a8a;
}

.drive-mark {
    position: relative;
    display: inline-block;
    width: 1.05rem;
    height: 0.95rem;
    flex: 0 0 1.05rem;
    transform: translateY(0.02rem);
}

.drive-mark::before,
.drive-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0, 100% 84%, 0 84%);
}

.drive-mark::before {
    background: conic-gradient(from 30deg, #1a73e8 0 33%, #34a853 0 66%, #fbbc04 0 100%);
}

.drive-mark::after {
    inset: 0.27rem 0.3rem 0.25rem;
    background: var(--surface);
}

.progress-edit-form {
    display: grid;
    gap: 0.55rem;
}

.progress-edit-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) 4.5rem auto auto;
    align-items: center;
    gap: 0.55rem;
}

.progress-edit-row input[type="range"] {
    width: 100%;
    accent-color: var(--gold);
}

.progress-edit-row input[type="number"] {
    min-height: 2.6rem;
    padding-inline: 0.65rem;
}

.duo-progress {
    height: 0.9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 60%, transparent);
    box-shadow: inset 0 2px 0 color-mix(in srgb, #000 24%, transparent);
}

.duo-progress span {
    border-radius: inherit;
    background: linear-gradient(180deg, #2eeaa8, #16b883);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22);
}

.duo-progress.progress-level-1 span {
    background: linear-gradient(180deg, #ff8a8a, #e45050);
}

.duo-progress.progress-level-2 span {
    background: linear-gradient(180deg, #ffd36a, #f4b321);
}

.duo-progress.progress-level-3 span {
    background: linear-gradient(180deg, #65d6c2, #27a892);
}

.duo-progress.progress-level-4 span {
    background: linear-gradient(180deg, #58e89b, #20b875);
}

.duo-progress.is-disabled {
    opacity: 0.45;
}

.progress-edit-row input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.topic-list {
    display: grid;
    gap: 0.75rem;
}

.compact-topic-list {
    gap: 0.5rem;
}

.topic-builder {
    gap: 0.55rem;
    padding: 0.65rem;
    border-radius: 12px;
}

.topic-builder > summary {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.topic-builder > summary::-webkit-details-marker {
    display: none;
}

.topic-builder-list {
    display: grid;
    gap: 0.55rem;
}

.topic-builder-actions {
    display: flex;
    justify-content: flex-end;
}

.topic-builder-row {
    align-items: end;
    background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

@media (min-width: 760px) {
    .topic-builder-row {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    }

    .topic-builder-row .check-row,
    .topic-builder-row .progress-edit-row,
    .topic-builder-row .duo-progress,
    .topic-builder-row [data-remove-topic-row] {
        grid-column: 1 / -1;
    }
}

.topic-card {
    position: relative;
    display: grid;
    gap: 0.48rem;
    padding: 0.68rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.topic-card p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.topic-row-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.45rem;
    padding: 0.42rem 0.5rem;
    border-radius: 10px;
}

.topic-row-card.is-static {
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.topic-static-summary {
    min-height: 2.1rem;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0.2rem 0.15rem;
}

.topic-static-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-inline-edit {
    position: relative;
    align-self: start;
}

.topic-inline-edit > summary {
    display: inline-grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}

.topic-inline-edit > summary::-webkit-details-marker {
    display: none;
}

.topic-inline-edit[open] > summary,
.topic-inline-edit > summary:hover {
    border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
    color: var(--gold);
}

.topic-quick-form {
    position: absolute;
    right: 0;
    z-index: 16;
    display: grid;
    gap: 0.45rem;
    width: min(24rem, 78vw);
    margin-top: 0.35rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
    border-radius: 12px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.topic-quick-form label {
    display: grid;
    gap: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.topic-quick-form input,
.topic-quick-form textarea {
    width: 100%;
}

.topic-save-button {
    justify-self: end;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 38%, transparent);
}

.topic-detail-card,
.topic-edit-card {
    padding: 0;
    overflow: hidden;
}

.topic-detail-card > summary,
.topic-edit-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.35rem;
    padding: 0.56rem 0.65rem;
    cursor: pointer;
    list-style: none;
}

.topic-detail-card > summary::-webkit-details-marker,
.topic-edit-card > summary::-webkit-details-marker {
    display: none;
}

.topic-detail-card > summary::after,
.topic-edit-card > summary::after {
    content: "v";
    display: inline-grid;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 1.15rem;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.topic-detail-card[open] > summary::after,
.topic-edit-card[open] > summary::after {
    content: "^";
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.topic-detail-body,
.topic-edit-form {
    display: grid;
    gap: 0.5rem;
    padding: 0 0.65rem 0.65rem;
}

.study-confetti {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 0;
    height: 0;
    pointer-events: none;
    animation: confetti-anchor 760ms ease-out both;
}

.study-confetti i {
    position: absolute;
    width: 0.38rem;
    height: 0.72rem;
    border-radius: 2px;
    background: var(--gold);
    animation: confetti-piece 760ms ease-out both;
}

.study-confetti i:nth-child(2) {
    background: var(--green);
    transform: rotate(24deg);
    animation-delay: 40ms;
}

.study-confetti i:nth-child(3) {
    background: #ff8a8a;
    transform: rotate(-28deg);
    animation-delay: 70ms;
}

.study-confetti i:nth-child(4) {
    background: #65d6c2;
    transform: rotate(42deg);
    animation-delay: 100ms;
}

.study-confetti i:nth-child(5) {
    background: #ffffff;
    transform: rotate(-54deg);
    animation-delay: 130ms;
}

@keyframes confetti-anchor {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes confetti-piece {
    from {
        opacity: 1;
        transform: translate(0, 0) rotate(0);
    }
    to {
        opacity: 0;
        transform: translate(calc((var(--x, 1) * 2rem)), -2.6rem) rotate(160deg);
    }
}

.study-confetti i:nth-child(1) { --x: -1.3; }
.study-confetti i:nth-child(2) { --x: -0.55; }
.study-confetti i:nth-child(3) { --x: 0.15; }
.study-confetti i:nth-child(4) { --x: 0.85; }
.study-confetti i:nth-child(5) { --x: 1.35; }

.study-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 0;
    height: 0;
    pointer-events: none;
}

.study-burst i {
    position: absolute;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--gold);
    animation: study-burst-piece 820ms cubic-bezier(.2, 0, .2, 1) both;
}

.study-burst.is-strong i {
    width: 0.46rem;
    height: 0.46rem;
}

.study-burst i:nth-child(2) { background: var(--green); --x: 1; --y: -1.05; animation-delay: 35ms; }
.study-burst i:nth-child(3) { background: var(--rose); --x: -1.1; --y: -0.85; animation-delay: 70ms; }
.study-burst i:nth-child(4) { background: var(--blue); --x: 0.65; --y: 1; animation-delay: 105ms; }
.study-burst i:nth-child(5) { background: #ffffff; --x: -0.7; --y: 1.05; animation-delay: 140ms; }
.study-burst i:nth-child(6) { background: var(--gold-strong); --x: 1.25; --y: 0.18; animation-delay: 175ms; }
.study-burst i:nth-child(7) { background: var(--green); --x: -1.25; --y: 0.05; animation-delay: 210ms; }

@keyframes study-burst-piece {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.65);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--x, 0) * 3.2rem), calc(-50% + var(--y, -1) * 2.4rem)) scale(1.1);
    }
}

.compact-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
    color: var(--muted);
    font-weight: 800;
}

.teacher-hero h1 .title-link {
    display: inline-flex;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popover-in {
    from {
        opacity: 0;
        transform: translateY(-0.25rem) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes streak-card-pop {
    from {
        opacity: 0;
        transform: translateY(0.35rem) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes streak-review-fill {
    from {
        width: 0;
    }
}

@keyframes welcome-card-pop {
    from {
        opacity: 0;
        transform: translateY(0.7rem) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcome-fade-out {
    to {
        opacity: 0;
        transform: scale(0.985);
    }
}

@keyframes welcome-glow-spin {
    from {
        transform: rotate(0deg) scale(0.9);
        opacity: 0;
    }
    16% {
        opacity: 0.72;
    }
    to {
        transform: rotate(340deg) scale(1.05);
        opacity: 0;
    }
}

@keyframes welcome-confetti-fall {
    from {
        opacity: 0;
        transform: translate3d(-0.3rem, 0, 0) rotate(0deg) scale(0.82);
    }
    16% {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translate3d(0.4rem, 22rem, 0) rotate(210deg) scale(1);
    }
}

@keyframes welcome-symbol-pulse {
    0%, 100% {
        opacity: 0.34;
        transform: scale(0.94);
    }
    50% {
        opacity: 0.82;
        transform: scale(1.04);
    }
}

@keyframes welcome-sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.4) rotate(0deg);
    }
    45%, 65% {
        opacity: 1;
        transform: scale(1) rotate(24deg);
    }
}

@keyframes daily-tip-in {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes daily-tip-out {
    to {
        opacity: 0;
        transform: translateY(0.25rem);
    }
}

@keyframes daily-tip-timer {
    from {
        width: calc(100% - 1.4rem);
    }
    to {
        width: 0;
    }
}

@keyframes piano-drift {
    from {
        transform: rotate(-9deg) translate3d(0, 0, 0);
    }
    to {
        transform: rotate(-7deg) translate3d(-0.6rem, 0.35rem, 0);
    }
}

@keyframes piano-drift-left {
    from {
        transform: rotate(8deg) translate3d(0, 0, 0);
    }
    to {
        transform: rotate(6deg) translate3d(0.7rem, -0.25rem, 0);
    }
}

@keyframes piano-key-pulse {
    0%,
    6.666% {
        opacity: 0.82;
    }
    6.667%,
    100% {
        opacity: 0;
    }
}

@keyframes piano-key-pulse-last {
    0%,
    6.666% {
        opacity: 0.82;
    }
    13.333%,
    100% {
        opacity: 0;
    }
}

@keyframes goal-confetti {
    0% {
        opacity: 0;
        transform: translate3d(0, -0.6rem, 0) scale(0.95);
    }
    18% {
        opacity: 0.82;
    }
    100% {
        opacity: 0.18;
        transform: translate3d(0, 0.9rem, 0) scale(1.04);
    }
}

@keyframes goal-badge-pop {
    0% {
        opacity: 0;
        transform: translateY(0.3rem) scale(0.9);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 28%, transparent);
    }
    55% {
        opacity: 1;
        transform: translateY(-0.04rem) scale(1.04);
        box-shadow: 0 0 0 0.45rem color-mix(in srgb, var(--green) 12%, transparent);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 0%, transparent);
    }
}

@keyframes side-confetti-left {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.55);
    }
    22% {
        opacity: 0.82;
    }
    100% {
        opacity: 0;
        transform: translate3d(7.2rem, -2.2rem, 0) scale(1.18);
    }
}

@keyframes side-confetti-right {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.55);
    }
    22% {
        opacity: 0.82;
    }
    100% {
        opacity: 0;
        transform: translate3d(-7.2rem, -2.2rem, 0) scale(1.18);
    }
}

@keyframes ambient-note-float {
    0% {
        opacity: 0;
        transform: translate3d(0, 1.1rem, 0) scale(0.92) rotate(-5deg);
    }
    18% {
        opacity: 0.22;
    }
    62% {
        opacity: 0.16;
        transform: translate3d(0.45rem, -1.65rem, 0) scale(1) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translate3d(0.7rem, -2.45rem, 0) scale(0.96) rotate(9deg);
    }
}

@keyframes ambient-note-depth-float {
    0% {
        opacity: 0;
        transform: translate3d(0, 1.6rem, 0) scale(0.92) rotate(-8deg);
    }
    20% {
        opacity: 0.18;
    }
    64% {
        opacity: 0.13;
        transform: translate3d(-0.7rem, -2.35rem, 0) scale(1.04) rotate(7deg);
    }
    100% {
        opacity: 0;
        transform: translate3d(-1.05rem, -3.35rem, 0) scale(1) rotate(11deg);
    }
}

@keyframes ambient-note-pop {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0);
    }
    58% {
        opacity: 0.95;
        transform: scale(1.42) rotate(8deg);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.2) rotate(-10deg);
        filter: blur(1px);
    }
}

@keyframes icon-lift {
    0%,
    100% {
        transform: translateY(0) rotate(0);
    }
    45% {
        transform: translateY(-0.12rem) rotate(-4deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 760px) {
    .piano-keys-ambient {
        right: -6.5rem;
        top: 7rem;
        width: 14rem;
        height: 4.2rem;
        opacity: 0.16;
    }

    .ambient-note {
        font-size: 1.35rem;
    }

    .streak-goal-modal {
        align-items: end;
        padding: 0.75rem;
    }

    .streak-goal-card {
        max-height: calc(100vh - 1.5rem);
        overflow: auto;
        padding: 1.05rem;
        border-radius: 18px;
    }

    .welcome-modal {
        align-items: end;
        padding: 0.75rem;
    }

    .welcome-card {
        border-radius: 18px;
    }

    .welcome-form {
        padding: 1.65rem 1rem 1rem;
    }

    .welcome-symbol-wrap {
        width: 5.7rem;
    }

    .welcome-symbol {
        width: 4.25rem;
        height: 4.25rem;
    }

    .streak-goal-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .daily-tip-card {
        right: 0.75rem;
        bottom: calc(5.65rem + env(safe-area-inset-bottom));
        width: min(20rem, calc(100vw - 1.5rem));
    }

    .daily-tip-card::after {
        content: "";
        position: absolute;
        left: 0.7rem;
        bottom: 0.45rem;
        height: 0.12rem;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--gold), var(--green));
        animation: daily-tip-timer 9s linear both;
    }

}

@media (max-width: 760px) {
    .suggest-field {
        grid-template-columns: 1fr;
    }

    .progress-edit-row {
        grid-template-columns: 1fr 4.5rem auto;
    }

    .study-area-card > summary {
        gap: 0.42rem;
        padding: 0.52rem 0.58rem;
        font-size: 0.82rem;
    }

    .study-item-card > summary {
        display: grid;
        grid-template-columns: 1.18rem minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 0.24rem 0.5rem;
        padding: 0.52rem 0.56rem;
    }

    .study-item-card > summary::before {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .study-item-card > summary > span:first-of-type {
        grid-column: 2;
        grid-row: 1;
    }

    .study-item-card > summary strong {
        font-size: 1.02rem;
        line-height: 1.18;
    }

    .study-item-card > summary small {
        font-size: 0.7rem;
    }

    .study-topic-preview {
        gap: 0.16rem;
        margin-top: 0.18rem;
    }

    .study-topic-pill {
        max-width: 100%;
        padding: 0.06rem 0.3rem;
        font-size: 0.58rem;
    }

    .study-item-card > summary::after {
        grid-column: 3;
        grid-row: 1;
        order: initial;
        margin-left: 0;
    }

    .study-item-card > summary .status-chip {
        grid-column: 4;
        grid-row: 1;
        order: initial;
        min-width: 2.85rem;
        padding-inline: 0.34rem;
        font-size: 0.62rem;
    }

    .study-item-card > summary .summary-progress,
    .summary-progress {
        width: 100%;
        min-width: 0;
        max-width: none;
        text-align: left;
    }

    .study-item-card > summary .summary-progress {
        grid-column: 2 / -1;
        grid-row: 2;
        order: initial;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0.38rem;
        margin-top: 0.06rem;
        font-size: 0.66rem;
    }

    .study-item-card > summary .summary-progress .duo-progress {
        width: 100%;
        min-width: 0;
    }

    .study-item-body {
        padding: 0.58rem 0.62rem 0.68rem 2.1rem;
    }

    .progress-edit-row .button {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .study-toggle-form.is-celebrating .study-toggle-button,
    .streak-note-badge,
    .streak-note-badge::before,
    .streak-note-badge::after,
    .streak-note-shape,
    .streak-goal-modal,
    .streak-goal-card,
    .streak-review-bar span,
    .goal-confetti-side,
    .piano-key-pulse,
    .daily-tip-card,
    .day-modal-backdrop,
    .day-popover {
        animation: none;
    }
}

@media (max-width: 759px) {
    .student-page .streak-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
        text-align: center;
    }

    .student-page .streak-note-badge {
        margin-inline: auto;
    }

    .student-page .streak-hero p {
        max-width: 100%;
    }

    .student-page .streak-hero .streak-celebration {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }

    .student-page .streak-hero .streak-celebration strong {
        font-size: 0.95rem;
    }

    .streak-off-panel {
        grid-template-columns: 1fr;
    }

    .streak-actions,
    .google-warning {
        align-items: stretch;
        justify-content: stretch;
    }

    .teacher-streak-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-streak-heading > form,
    .teacher-streak-heading .study-toggle-button {
        width: 100%;
    }

    .teacher-streak-settings-body {
        grid-template-columns: 1fr;
    }

    .week-mode-toggle {
        justify-self: start;
    }
}

.student-secondary-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.student-secondary-grid > .panel {
    display: grid;
    min-height: 9rem;
    align-content: start;
}

@media (max-width: 900px) {
    .student-secondary-grid {
        grid-template-columns: 1fr;
    }

    .student-detail-actions {
        justify-content: flex-start;
    }
}

@media (min-width: 760px) {
    .teacher-section.two-panel-section {
        align-items: start;
    }

    .teacher-section.two-panel-section > .panel,
    .teacher-section.two-panel-section > form.panel {
        height: auto;
    }
}
 .bot-trap-field {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Welcome modal celebration pass - scoped to the one-time login greeting. */
.welcome-modal {
    background:
        radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 25rem),
        rgba(0, 0, 0, 0.72);
}

.welcome-modal-glow {
    width: min(46rem, 90vw);
    background:
        conic-gradient(from 0deg,
            transparent,
            color-mix(in srgb, var(--gold) 52%, transparent),
            color-mix(in srgb, var(--green) 34%, transparent),
            transparent,
            color-mix(in srgb, #ff7aa9 30%, transparent),
            color-mix(in srgb, #7cb7ff 28%, transparent),
            transparent);
    filter: blur(18px) saturate(1.18);
    opacity: 0.9;
    animation: welcome-glow-spin 7.2s ease-out both;
}

.welcome-card {
    box-shadow:
        0 30px 110px rgba(0, 0, 0, 0.62),
        0 0 46px color-mix(in srgb, var(--gold) 16%, transparent);
}

.welcome-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 20%, color-mix(in srgb, var(--gold) 48%, transparent) 0 0.12rem, transparent 0.18rem),
        radial-gradient(circle at 82% 26%, color-mix(in srgb, var(--green) 42%, transparent) 0 0.12rem, transparent 0.2rem),
        radial-gradient(circle at 72% 78%, color-mix(in srgb, #7cb7ff 42%, transparent) 0 0.1rem, transparent 0.18rem),
        radial-gradient(circle at 24% 76%, color-mix(in srgb, #ff7aa9 40%, transparent) 0 0.11rem, transparent 0.2rem);
    opacity: 0.65;
    animation: welcome-sparkle-field 2.4s ease-in-out infinite;
}

.welcome-confetti span,
.welcome-confetti i {
    top: -2.8rem;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c, var(--gold)) 48%, transparent));
    animation: welcome-confetti-fall var(--d, 4.6s) cubic-bezier(.16, .72, .22, 1) var(--delay, 0s) both;
}

.welcome-confetti span {
    font-size: var(--s, 1.28rem);
}

.welcome-confetti i {
    width: var(--s, 0.58rem);
    height: var(--s, 0.58rem);
    border-radius: 0.18rem;
}

.welcome-confetti span:nth-child(1) { --x: 6%; --c: var(--gold); --s: 1.45rem; --delay: .05s; --d: 4.9s; --drift: 3.4rem; --rot: 360deg; }
.welcome-confetti i:nth-child(2) { --x: 13%; --c: var(--green); --s: .62rem; --delay: .18s; --d: 4.6s; --drift: -2.8rem; --rot: 280deg; }
.welcome-confetti span:nth-child(3) { --x: 20%; --c: #7cb7ff; --s: 1.55rem; --delay: .1s; --d: 5.1s; --drift: 2.4rem; --rot: 420deg; }
.welcome-confetti i:nth-child(4) { --x: 28%; --c: #ff7aa9; --s: .54rem; --delay: .32s; --d: 4.8s; --drift: -3rem; --rot: 300deg; }
.welcome-confetti span:nth-child(5) { --x: 35%; --c: var(--gold); --s: 1.24rem; --delay: .24s; --d: 4.7s; --drift: 2.8rem; --rot: 390deg; }
.welcome-confetti i:nth-child(6) { --x: 43%; --c: var(--green); --s: .7rem; --delay: .06s; --d: 5s; --drift: -2rem; --rot: 330deg; }
.welcome-confetti span:nth-child(7) { --x: 50%; --c: #ff7aa9; --s: 1.48rem; --delay: .2s; --d: 5.2s; --drift: 2.1rem; --rot: 460deg; }
.welcome-confetti i:nth-child(8) { --x: 58%; --c: #7cb7ff; --s: .56rem; --delay: .42s; --d: 4.9s; --drift: -2.6rem; --rot: 340deg; }
.welcome-confetti span:nth-child(9) { --x: 65%; --c: var(--gold); --s: 1.36rem; --delay: .12s; --d: 5.3s; --drift: 2.9rem; --rot: 410deg; }
.welcome-confetti i:nth-child(10) { --x: 73%; --c: #ff7aa9; --s: .66rem; --delay: .54s; --d: 4.8s; --drift: -3.2rem; --rot: 360deg; }
.welcome-confetti span:nth-child(11) { --x: 82%; --c: var(--green); --s: 1.42rem; --delay: .45s; --d: 5.1s; --drift: 2.5rem; --rot: 440deg; }
.welcome-confetti i:nth-child(12) { --x: 92%; --c: var(--gold); --s: .58rem; --delay: .62s; --d: 4.7s; --drift: -2.7rem; --rot: 320deg; }
.welcome-confetti span:nth-child(13) { --x: 9%; --c: #ff7aa9; --s: 1.18rem; --delay: .82s; --d: 4.5s; --drift: 2rem; --rot: 390deg; }
.welcome-confetti i:nth-child(14) { --x: 18%; --c: #7cb7ff; --s: .48rem; --delay: .74s; --d: 4.6s; --drift: -2.4rem; --rot: 310deg; }
.welcome-confetti span:nth-child(15) { --x: 26%; --c: var(--green); --s: 1.28rem; --delay: .9s; --d: 4.9s; --drift: 2.7rem; --rot: 460deg; }
.welcome-confetti i:nth-child(16) { --x: 38%; --c: var(--gold); --s: .6rem; --delay: .7s; --d: 5s; --drift: -2.1rem; --rot: 340deg; }
.welcome-confetti span:nth-child(17) { --x: 47%; --c: #7cb7ff; --s: 1.2rem; --delay: 1.02s; --d: 4.8s; --drift: 2.4rem; --rot: 420deg; }
.welcome-confetti i:nth-child(18) { --x: 55%; --c: #ff7aa9; --s: .52rem; --delay: .88s; --d: 4.7s; --drift: -2.8rem; --rot: 300deg; }
.welcome-confetti span:nth-child(19) { --x: 63%; --c: var(--gold); --s: 1.32rem; --delay: .78s; --d: 5.2s; --drift: 3.2rem; --rot: 450deg; }
.welcome-confetti i:nth-child(20) { --x: 70%; --c: var(--green); --s: .64rem; --delay: 1.08s; --d: 4.9s; --drift: -2rem; --rot: 360deg; }
.welcome-confetti span:nth-child(21) { --x: 79%; --c: #ff7aa9; --s: 1.1rem; --delay: .96s; --d: 4.5s; --drift: 2.2rem; --rot: 410deg; }
.welcome-confetti i:nth-child(22) { --x: 87%; --c: #7cb7ff; --s: .5rem; --delay: .86s; --d: 4.8s; --drift: -3rem; --rot: 330deg; }
.welcome-confetti span:nth-child(23) { --x: 94%; --c: var(--gold); --s: 1.26rem; --delay: 1.16s; --d: 4.7s; --drift: -2.2rem; --rot: 390deg; }
.welcome-confetti i:nth-child(24) { --x: 4%; --c: var(--green); --s: .58rem; --delay: 1.12s; --d: 4.9s; --drift: 3.1rem; --rot: 350deg; }
.welcome-confetti span:nth-child(n+25) { --s: 1.18rem; --d: 4.4s; }
.welcome-confetti i:nth-child(n+26) { --s: .52rem; --d: 4.6s; }
.welcome-confetti span:nth-child(25) { --x: 14%; --c: #7cb7ff; --delay: 1.28s; --drift: 2.8rem; --rot: 430deg; }
.welcome-confetti i:nth-child(26) { --x: 31%; --c: var(--gold); --delay: 1.22s; --drift: -2.6rem; --rot: 330deg; }
.welcome-confetti span:nth-child(27) { --x: 49%; --c: var(--green); --delay: 1.35s; --drift: 2.2rem; --rot: 400deg; }
.welcome-confetti i:nth-child(28) { --x: 68%; --c: #ff7aa9; --delay: 1.3s; --drift: -3.1rem; --rot: 350deg; }
.welcome-confetti span:nth-child(29) { --x: 86%; --c: var(--gold); --delay: 1.4s; --drift: 2.4rem; --rot: 450deg; }
.welcome-confetti i:nth-child(30) { --x: 96%; --c: #7cb7ff; --delay: 1.5s; --drift: -2.8rem; --rot: 310deg; }
.welcome-confetti span:nth-child(31) { --x: 22%; --c: #ff7aa9; --delay: 1.55s; --drift: 3rem; --rot: 410deg; }
.welcome-confetti i:nth-child(32) { --x: 41%; --c: var(--green); --delay: 1.48s; --drift: -2rem; --rot: 360deg; }
.welcome-confetti span:nth-child(33) { --x: 60%; --c: #7cb7ff; --delay: 1.62s; --drift: 2.9rem; --rot: 440deg; }
.welcome-confetti i:nth-child(34) { --x: 76%; --c: var(--gold); --delay: 1.58s; --drift: -2.5rem; --rot: 320deg; }
.welcome-confetti span:nth-child(35) { --x: 89%; --c: var(--green); --delay: 1.72s; --drift: 2.1rem; --rot: 390deg; }
.welcome-confetti i:nth-child(36) { --x: 11%; --c: #ff7aa9; --delay: 1.68s; --drift: -2.3rem; --rot: 340deg; }

.welcome-symbol-wrap {
    animation: welcome-dodo-float 2.7s ease-in-out infinite;
    transition: filter 180ms ease;
}

.welcome-card:hover .welcome-symbol-wrap,
.welcome-card:focus-within .welcome-symbol-wrap {
    filter: drop-shadow(0 0 24px color-mix(in srgb, var(--gold) 46%, transparent));
    animation-duration: 1.55s;
}

.welcome-symbol-wrap::before {
    animation: welcome-symbol-pulse 2.1s ease-in-out infinite;
}

.welcome-symbol-wrap::after {
    animation: welcome-sparkle 1.65s ease-in-out infinite;
}

.welcome-symbol {
    animation: welcome-symbol-shine 3.4s ease-in-out infinite;
    transition: filter 180ms ease;
}

.welcome-card:hover .welcome-symbol,
.welcome-card:focus-within .welcome-symbol {
    filter:
        drop-shadow(0 0 18px color-mix(in srgb, var(--gold) 62%, transparent))
        drop-shadow(0 0 28px color-mix(in srgb, var(--green) 22%, transparent));
}

@keyframes welcome-glow-spin {
    from {
        transform: rotate(0deg) scale(0.86);
        opacity: 0;
    }
    12%, 62% {
        opacity: 0.9;
    }
    to {
        transform: rotate(420deg) scale(1.1);
        opacity: 0;
    }
}

@keyframes welcome-confetti-fall {
    from {
        opacity: 0;
        transform: translate3d(calc(var(--drift, 2rem) * -0.2), 0, 0) rotate(0deg) scale(0.72);
    }
    10%, 78% {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translate3d(var(--drift, 2rem), min(38rem, 88vh), 0) rotate(var(--rot, 380deg)) scale(1.06);
    }
}

@keyframes welcome-dodo-float {
    0%, 100% {
        transform: translateY(0) rotate(-1deg) scale(1);
    }
    45% {
        transform: translateY(-0.28rem) rotate(1.5deg) scale(1.035);
    }
}

@keyframes welcome-symbol-shine {
    0%, 100% {
        filter: drop-shadow(0 0 16px color-mix(in srgb, var(--gold) 36%, transparent));
    }
    48% {
        filter:
            drop-shadow(0 0 22px color-mix(in srgb, var(--gold) 62%, transparent))
            drop-shadow(0 0 32px color-mix(in srgb, var(--green) 22%, transparent));
    }
}

@keyframes welcome-sparkle-field {
    0%, 100% {
        opacity: 0.36;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.82;
        transform: scale(1.01);
    }
}

@media (max-width: 760px) {
    .welcome-modal-glow {
        width: 34rem;
    }

    .welcome-symbol-wrap {
        width: 6.15rem;
    }

    .welcome-confetti span {
        font-size: var(--s, 1.15rem);
    }
}
/* Dodomisol package 1: compact login and grouped navigation */
.login-page .login-shell { min-height: calc(100svh - 4.25rem); padding: 1rem; }
.login-page .login-panel { gap: 0.46rem; width: min(22.5rem, 100%); padding: 0.9rem 1rem 1rem; border-radius: 10px; }
.login-page .login-panel { transform: translateY(-1.75rem); }
.login-page .login-brand-logo { width: min(10.5rem, 58vw); margin-bottom: -0.15rem; }
.login-page .login-panel h1 { margin: 0; font-size: 1.55rem; }
.login-page .login-panel label { font-size: 0.86rem; }
.login-page .login-panel input { min-height: 2.55rem; padding-block: 0.56rem; }
.login-page .login-panel .button { min-height: 2.55rem; }
.login-page .login-small-link { margin-top: 0.05rem; text-align: center; }
.login-help-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; justify-content: center; }
.compact-auth-panel > .dodo-mascot { justify-self: center; }
.compact-auth-panel > p { margin: 0; color: var(--muted); text-align: center; }
.compact-auth-form { display: grid; width: 100%; gap: 0.48rem; }
.pending-existing-access { display: grid; gap: 0.3rem; justify-items: center; padding: 0.7rem; border: 1px solid color-mix(in srgb, var(--teal) 36%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--teal) 7%, transparent); text-align: center; }
.pending-existing-access span { color: var(--muted); font-size: 0.78rem; }
.access-help-card { display: grid; width: min(34rem, 100%); gap: 0.75rem; margin-inline: auto; }
.access-help-identity { display: grid; gap: 0.12rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.access-help-identity span,
.access-help-identity small { color: var(--muted); }
.access-help-email-form { margin: 0; }
.access-help-email-form .button { width: 100%; }
.access-help-password { border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.access-help-password > summary { min-height: 2.8rem; padding: 0.68rem 0.78rem; color: var(--text); cursor: pointer; font-weight: 850; list-style-position: inside; }
.access-help-password > form { padding: 0 0.78rem 0.78rem; }
.authenticated-main-nav { display: flex; align-items: center; justify-content: center; gap: 0.55rem; overflow: visible; padding-bottom: 0; }
.authenticated-submenu { position: relative; }
.authenticated-submenu > summary, .profile-nav-trigger { display: inline-flex; align-items: center; gap: 0.38rem; color: var(--muted); cursor: pointer; font-size: 0.92rem; font-weight: 750; list-style: none; white-space: nowrap; }
.authenticated-submenu > summary::-webkit-details-marker, .profile-nav-trigger::-webkit-details-marker, .mobile-tabbar-menu > summary::-webkit-details-marker { display: none; }
.authenticated-submenu > summary::after, .profile-nav-trigger::after { content: "⌄"; margin-left: 0.08rem; color: currentColor; font-size: 0.72rem; transition: transform 160ms ease; }
.authenticated-submenu[open] > summary::after, .profile-nav-menu[open] > summary::after { transform: rotate(180deg); }
.authenticated-submenu[open] .nav-submenu { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.authenticated-main-nav > a, .authenticated-submenu > summary { display: inline-flex; min-height: 2.3rem; align-items: center; gap: 0.38rem; padding: 0.36rem 0.45rem; border-radius: 8px; }
.authenticated-main-nav > a.is-active, .authenticated-submenu.is-active > summary, .authenticated-submenu:focus-within > summary { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); }
.nav-submenu a, .mobile-tabbar-panel a { align-items: center; gap: 0.55rem; }
.nav-attention-badge { display: inline-grid; min-width: 1.05rem; height: 1.05rem; flex: 0 0 auto; place-items: center; margin-left: auto; padding: 0 0.24rem; border: 1px solid color-mix(in srgb, var(--rose) 76%, #fff); border-radius: 999px; background: var(--rose); color: #fff; font-size: 0.62rem; font-weight: 900; line-height: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 72%, transparent); }
.authenticated-submenu > summary .nav-attention-badge, .authenticated-main-nav > a .nav-attention-badge { margin-left: 0.06rem; }
.signup-duplicate-warning { max-width: 42rem; color: var(--gold-strong); font-weight: 800; line-height: 1.35; }
.profile-nav-menu { position: relative; }
.profile-nav-trigger { min-height: 2.4rem; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.profile-nav-panel { position: absolute; top: calc(100% + 0.55rem); right: 0; z-index: 60; display: grid; gap: 0.2rem; width: 13.5rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--surface-strong) 96%, #000); box-shadow: var(--shadow); }
.profile-nav-panel a, .profile-nav-panel .profile-menu-action { display: flex; width: 100%; min-height: 2.4rem; align-items: center; gap: 0.55rem; padding: 0.45rem 0.58rem; border-radius: 7px; color: var(--muted); font-size: 0.86rem; font-weight: 800; text-align: left; }
.profile-nav-panel a:hover, .profile-nav-panel a.is-active, .profile-nav-panel .profile-menu-action:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); }
.profile-nav-panel form { margin: 0; }
.more-icon::before, .more-icon::after, .target-icon::before, .target-icon::after { content: ""; position: absolute; }
.more-icon::before { left: 0.06rem; top: 0.42rem; width: 0.16rem; height: 0.16rem; border-radius: 50%; background: currentColor; box-shadow: 0.35rem 0 0 currentColor, 0.7rem 0 0 currentColor; }
.target-icon { color: var(--rose); border: 1.7px solid currentColor; border-radius: 50%; }
.target-icon::before { inset: 0.2rem; border: 1.7px solid currentColor; border-radius: 50%; }
.target-icon::after { top: 50%; left: 50%; width: 0.12rem; height: 0.12rem; border-radius: 50%; background: currentColor; transform: translate(-50%, -50%); }
@media (max-width: 759px) {
    .login-page .site-header { min-height: 3.8rem; }
    .login-page .login-shell { min-height: calc(100svh - 3.8rem); padding: 0.65rem; }
    .login-page .login-panel { gap: 0.38rem; padding: 0.72rem 0.82rem 0.82rem; }
    .login-page .login-panel { transform: translateY(-0.35rem); }
    .login-page .login-brand-logo { width: min(9rem, 48vw); }
    .login-page .login-panel h1 { font-size: 1.35rem; }
    .is-authenticated .account-nav > .profile-nav-menu { display: none; }
    .mobile-tabbar.mobile-tabbar-compact { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.22rem; overflow: visible; }
    .mobile-tabbar-compact > .mobile-tabbar-item, .mobile-tabbar-compact > .mobile-tabbar-menu, .mobile-tabbar-compact > .mobile-tabbar-menu > .mobile-tabbar-item { width: 100%; min-width: 0; }
    .mobile-tabbar-menu { position: relative; display: grid; min-width: 0; }
    .mobile-tabbar-item { position: relative; }
    .mobile-tabbar-item > .nav-attention-badge { position: absolute; top: 0.22rem; right: max(0.18rem, calc(50% - 1.55rem)); margin: 0; }
    .mobile-tabbar-menu.is-active > .mobile-tabbar-item, .mobile-tabbar-menu[open] > .mobile-tabbar-item { border-color: color-mix(in srgb, var(--gold) 34%, transparent); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); color: var(--gold-strong); }
    .mobile-tabbar-panel { position: absolute; bottom: calc(100% + 0.7rem); left: 0; z-index: 65; display: grid; gap: 0.22rem; width: min(17rem, calc(100vw - 2rem)); padding: 0.52rem; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface-strong) 97%, #000); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5); transform-origin: bottom left; animation: mobile-menu-in 160ms ease-out both; }
    .mobile-tabbar-panel-right { right: 0; left: auto; transform-origin: bottom right; }
    .mobile-tabbar-panel a, .mobile-tabbar-panel button { display: flex; width: 100%; min-height: 2.55rem; align-items: center; gap: 0.62rem; padding: 0.5rem 0.62rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 0.88rem; font-weight: 800; text-align: left; text-decoration: none; }
    .mobile-tabbar-panel a:hover, .mobile-tabbar-panel a:active, .mobile-tabbar-panel button:hover, .mobile-tabbar-panel button:active, .mobile-tabbar-panel a.is-active { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); }
    .mobile-tabbar-panel form { margin: 0; }
}
@keyframes mobile-menu-in { from { opacity: 0; transform: translateY(0.35rem) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
/* Dodomisol package 1: billing chronology */
.billing-group {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.8rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.billing-group-heading {
    display: flex;
    min-height: 2.7rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.58rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
}

.billing-group-heading > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.billing-group-heading > span {
    display: grid;
    min-width: 1.6rem;
    height: 1.6rem;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 14%, transparent);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
}

.billing-group-overdue {
    border-color: color-mix(in srgb, var(--rose) 54%, var(--line));
}

.billing-group-overdue .billing-group-heading {
    background: color-mix(in srgb, var(--rose) 13%, var(--surface-strong));
    color: color-mix(in srgb, var(--rose) 76%, white);
}

.billing-group-current {
    border-color: color-mix(in srgb, var(--gold) 38%, var(--line));
}

.billing-fee-list {
    margin: 0;
}

.billing-fee-list > li {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}

.billing-fee-list > li:last-child {
    border-bottom: 0;
}

.billing-fee-main {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.billing-fee-main > span,
.billing-group-empty {
    color: var(--muted);
}

.billing-group-empty {
    margin: 0;
    padding: 0.75rem;
}

.billing-history-details {
    margin-top: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.billing-history-details > summary {
    padding: 0.75rem;
    cursor: pointer;
    font-weight: 850;
}

.billing-history-content {
    padding: 0 0.7rem 0.7rem;
}

.alert-icon {
    color: var(--rose);
    border: 1.7px solid currentColor;
    border-radius: 50%;
}

.alert-icon::before {
    content: "!";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 950;
}

@media (max-width: 759px) {
    .billing-fee-list > li {
        align-items: flex-start;
    }

    .billing-fee-list .row-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* 2026-07 unified card accents and compact study-plan units */
.student-subnav {
    gap: 0.18rem;
}

.student-subnav-divider {
    align-self: center;
    color: color-mix(in srgb, var(--muted) 42%, transparent);
    font-size: 0.82rem;
    line-height: 1;
    pointer-events: none;
}

.student-subnav .student-tab-summary .tab-icon { color: var(--gold); }
.student-subnav .student-tab-calendar .tab-icon { color: #7cb7ff; }
.student-subnav .student-tab-lessons .tab-icon { color: #ff8a8a; }
.student-subnav .student-tab-goal .tab-icon { color: #58e89b; }
.student-subnav .student-tab-plan .tab-icon { color: #65d6c2; }
.student-subnav .student-tab-billing .tab-icon { color: #ffd36a; }

.student-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, 10.4rem);
    gap: 0.55rem;
}

.student-detail-actions > a,
.student-detail-actions > form,
.student-detail-actions > a.button,
.student-detail-actions > form > .button {
    width: 100%;
    min-width: 0;
    height: 3rem;
    min-height: 3rem;
    margin: 0;
    box-sizing: border-box;
}

.student-detail-actions > a { grid-column: 1; grid-row: 1; }
.student-detail-actions > form { grid-column: 2; grid-row: 1; }

.study-item-card {
    overflow: hidden;
    border-radius: 8px;
}

.study-item-card > summary {
    min-height: 2.45rem;
    padding: 0.38rem 0.52rem;
}

.study-item-card > summary strong {
    overflow: hidden;
    font-size: 0.94rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.study-item-card > summary small {
    font-size: 0.66rem;
}

.study-item-card > summary .summary-progress {
    width: min(9rem, 22vw);
    flex: 0 1 9rem;
}

.study-item-body {
    padding: 0.55rem 0.62rem 0.65rem;
}

.study-unit-summary,
.weekly-unit-picker {
    display: block;
    width: 100%;
    max-width: none;
    overflow: hidden;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
}

.study-unit-summary > summary,
.weekly-unit-picker > summary {
    display: flex;
    min-height: 2.25rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.5rem;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 850;
}

.study-unit-summary > summary::-webkit-details-marker,
.weekly-unit-picker > summary::-webkit-details-marker { display: none; }

.study-unit-summary > summary::before,
.weekly-unit-picker > summary::before {
    content: "";
    width: 0.42rem;
    height: 0.54rem;
    flex: 0 0 0.42rem;
    clip-path: polygon(0 0, 100% 50%, 0 100%, 32% 50%);
    background: var(--gold);
    transition: transform 160ms ease;
}

.study-unit-summary[open] > summary::before,
.weekly-unit-picker[open] > summary::before { transform: rotate(90deg); }

.study-unit-summary > summary small,
.weekly-unit-picker > summary small {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 750;
}

.study-unit-summary[open] > summary,
.weekly-unit-picker[open] > summary {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.study-unit-summary-grid,
.weekly-unit-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.study-unit-summary-row {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    gap: 0.34rem;
    align-items: center;
    min-width: 0;
    min-height: 2.35rem;
    padding: 0.25rem 0.38rem;
    border: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
}

.study-unit-summary-row + .study-unit-summary-row {
    padding-top: 0.25rem;
    border-top: 0;
}

.study-unit-summary-row .study-unit-state {
    width: 0.9rem;
    height: 0.9rem;
    font-size: 0.62rem;
}

.study-unit-summary-name {
    display: block;
    overflow: hidden;
}

.study-unit-summary-name strong {
    font-size: 0.74rem;
    line-height: 1.1;
}

.study-unit-summary-name small {
    margin-top: 0.04rem;
    font-size: 0.58rem;
}

.study-unit-summary-row .status-chip {
    min-width: 0;
    padding: 0.1rem 0.28rem;
    font-size: 0.55rem;
}

.weekly-unit-picker {
    margin-block: 0.45rem;
    border-color: color-mix(in srgb, var(--gold) 26%, var(--line));
}

.weekly-unit-picker > p {
    margin: 0;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.7rem;
}

.weekly-unit-check-grid > label {
    display: grid;
    grid-template-columns: 0.95rem minmax(0, 1fr);
    gap: 0.35rem;
    align-items: center;
    min-width: 0;
    min-height: 2.35rem;
    margin: 0;
    padding: 0.25rem 0.38rem;
    border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    cursor: pointer;
}

.weekly-unit-check-grid input {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
    accent-color: var(--gold);
}

.weekly-unit-check-grid span,
.weekly-unit-check-grid strong,
.weekly-unit-check-grid small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-unit-check-grid strong { font-size: 0.72rem; }
.weekly-unit-check-grid small { color: var(--muted); font-size: 0.58rem; }

@media (max-width: 1080px) {
    .study-unit-summary-grid,
    .weekly-unit-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .student-subnav-divider { display: none; }
    .student-subnav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .35rem;
    }
    .student-subnav button {
        width: 100%;
        min-height: 3rem;
        justify-content: center;
        padding-inline: .35rem;
        font-size: .76rem;
        line-height: 1.15;
        white-space: normal;
    }
    .student-detail-actions {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .student-detail-actions > a { grid-column: 1; grid-row: 1; }
    .student-detail-actions > form { grid-column: 2; grid-row: 1; }
    .student-detail-actions .button {
        height: 3rem;
        min-height: 3rem;
        padding-inline: 0.45rem;
        font-size: 0.78rem;
        white-space: nowrap;
    }
    .study-item-card > summary {
        grid-template-columns: 1rem minmax(0, 1fr) auto;
        min-height: 2.4rem;
        padding: 0.36rem 0.42rem;
    }
    .study-item-card > summary::before {
        width: 1rem;
        height: 1rem;
        flex-basis: 1rem;
        grid-column: 1;
        grid-row: 1;
    }
    .study-item-card > summary > span:first-of-type { grid-column: 2; grid-row: 1; }
    .study-item-card > summary::after { grid-column: 3; grid-row: 1; }
    .study-item-card > summary .status-chip { display: none; }
    .study-item-card > summary .summary-progress {
        grid-column: 2 / -1;
        grid-row: 2;
        width: 100%;
    }
    .study-item-body { padding: 0.48rem; }
}

@media (max-width: 360px) {
    .study-unit-summary-grid,
    .weekly-unit-check-grid { grid-template-columns: 1fr; }
}
/* Dodomisol package 1: welcome side celebration */
.welcome-modal-glow { z-index: 0; }
.welcome-card { z-index: 2; }
.welcome-side-burst {
    position: absolute;
    z-index: 3;
    top: 8%;
    bottom: 7%;
    width: min(26rem, 42vw);
    pointer-events: none;
    overflow: visible;
}
.welcome-side-burst.is-left { left: -2rem; }
.welcome-side-burst.is-right { right: -2rem; }
.welcome-side-burst span,
.welcome-side-burst i {
    position: absolute;
    top: var(--y, 50%);
    color: var(--c, var(--gold));
    opacity: 0;
    filter: drop-shadow(0 0 9px color-mix(in srgb, var(--c, var(--gold)) 52%, transparent));
}
.welcome-side-burst span {
    font-family: Georgia, "Times New Roman", serif;
    font-size: var(--s, 1.4rem);
    font-weight: 900;
}
.welcome-side-burst i {
    width: var(--s, 0.64rem);
    height: calc(var(--s, 0.64rem) * 0.62);
    border-radius: 0.18rem;
    background: var(--c, var(--gold));
}
.welcome-side-burst.is-left span,
.welcome-side-burst.is-left i {
    left: -1rem;
    animation: welcome-confetti-side-left var(--d, 3.8s) cubic-bezier(.14, .72, .2, 1) var(--delay, .1s) both;
}
.welcome-side-burst.is-right span,
.welcome-side-burst.is-right i {
    right: -1rem;
    animation: welcome-confetti-side-right var(--d, 3.8s) cubic-bezier(.14, .72, .2, 1) var(--delay, .1s) both;
}
.welcome-side-burst > :nth-child(1) { --y: 5%; --c: var(--gold); --delay: .08s; --d: 3.8s; --s: 1.5rem; --dx: 16rem; --dy: 8rem; --rot: 460deg; }
.welcome-side-burst > :nth-child(2) { --y: 13%; --c: var(--green); --delay: .24s; --d: 4.1s; --s: .72rem; --dx: 12rem; --dy: 13rem; --rot: 390deg; }
.welcome-side-burst > :nth-child(3) { --y: 22%; --c: #7cb7ff; --delay: .4s; --d: 3.9s; --s: 1.65rem; --dx: 18rem; --dy: 5rem; --rot: 520deg; }
.welcome-side-burst > :nth-child(4) { --y: 31%; --c: #ff7aa9; --delay: .12s; --d: 4.3s; --s: .66rem; --dx: 14rem; --dy: 17rem; --rot: 410deg; }
.welcome-side-burst > :nth-child(5) { --y: 41%; --c: var(--gold); --delay: .58s; --d: 4s; --s: 1.42rem; --dx: 19rem; --dy: 9rem; --rot: 480deg; }
.welcome-side-burst > :nth-child(6) { --y: 50%; --c: var(--green); --delay: .3s; --d: 4.25s; --s: .78rem; --dx: 13rem; --dy: 15rem; --rot: 360deg; }
.welcome-side-burst > :nth-child(7) { --y: 59%; --c: #ff7aa9; --delay: .7s; --d: 3.75s; --s: 1.58rem; --dx: 17rem; --dy: 6rem; --rot: 540deg; }
.welcome-side-burst > :nth-child(8) { --y: 68%; --c: #7cb7ff; --delay: .46s; --d: 4.2s; --s: .62rem; --dx: 15rem; --dy: 12rem; --rot: 420deg; }
.welcome-side-burst > :nth-child(9) { --y: 77%; --c: var(--gold); --delay: .18s; --d: 4.4s; --s: 1.32rem; --dx: 20rem; --dy: 7rem; --rot: 500deg; }
.welcome-side-burst > :nth-child(10) { --y: 87%; --c: #ff7aa9; --delay: .78s; --d: 3.9s; --s: .7rem; --dx: 11rem; --dy: 10rem; --rot: 370deg; }
.welcome-side-burst > :nth-child(11) { --y: 10%; --c: var(--green); --delay: 1.05s; --d: 3.7s; --s: 1.46rem; --dx: 15rem; --dy: 20rem; --rot: 470deg; }
.welcome-side-burst > :nth-child(12) { --y: 26%; --c: #7cb7ff; --delay: .9s; --d: 4.05s; --s: .6rem; --dx: 18rem; --dy: 14rem; --rot: 430deg; }
.welcome-side-burst > :nth-child(13) { --y: 45%; --c: var(--gold); --delay: 1.18s; --d: 3.85s; --s: 1.38rem; --dx: 12rem; --dy: 18rem; --rot: 510deg; }
.welcome-side-burst > :nth-child(14) { --y: 64%; --c: var(--green); --delay: 1s; --d: 4.15s; --s: .74rem; --dx: 17rem; --dy: 11rem; --rot: 400deg; }
.welcome-side-burst > :nth-child(15) { --y: 82%; --c: #ff7aa9; --delay: 1.3s; --d: 3.8s; --s: 1.52rem; --dx: 14rem; --dy: 16rem; --rot: 490deg; }
.welcome-side-burst > :nth-child(16) { --y: 94%; --c: #7cb7ff; --delay: 1.12s; --d: 4.25s; --s: .64rem; --dx: 19rem; --dy: 8rem; --rot: 450deg; }
@keyframes welcome-confetti-side-left {
    0% { opacity: 0; transform: translate3d(-2rem, 3rem, 0) rotate(-80deg) scale(.55); }
    12%, 74% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--dx, 15rem), var(--dy, 10rem), 0) rotate(var(--rot, 430deg)) scale(1.08); }
}
@keyframes welcome-confetti-side-right {
    0% { opacity: 0; transform: translate3d(2rem, 3rem, 0) rotate(80deg) scale(.55); }
    12%, 74% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(calc(var(--dx, 15rem) * -1), var(--dy, 10rem), 0) rotate(calc(var(--rot, 430deg) * -1)) scale(1.08); }
}
@media (max-width: 760px) {
    .welcome-side-burst { top: 12%; bottom: 10%; width: 36vw; }
    .welcome-side-burst > * { --dx: 7rem !important; }
    .welcome-side-burst span { font-size: min(var(--s, 1.3rem), 1.25rem); }
}
@media (prefers-reduced-motion: reduce) {
    .welcome-side-burst { display: none; }
}
/* Dodomisol package 1: study duplicate, progress and lesson break */
.study-duplicate-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: color-mix(in srgb, var(--gold) 8%, var(--surface));
}
.study-duplicate-notice strong,
.study-duplicate-notice p { display: block; margin: 0.08rem 0 0; }
.study-duplicate-notice p { color: var(--muted); font-size: 0.82rem; }
.study-duplicate-notice .compact-actions { flex: 0 0 auto; }
.progress-edit-row input[type="range"] {
    appearance: none;
    height: 0.5rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green) 0 var(--progress, 0%), color-mix(in srgb, var(--line) 72%, transparent) var(--progress, 0%) 100%);
    box-shadow: inset 0 1px 2px color-mix(in srgb, #000 24%, transparent);
}
.progress-edit-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid var(--surface-strong);
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}
.progress-edit-row input[type="range"]::-moz-range-thumb {
    width: 0.92rem;
    height: 0.92rem;
    border: 2px solid var(--surface-strong);
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}
.lesson-break-panel { display: grid; gap: 0.85rem; }
.lesson-break-list { display: grid; gap: 0.48rem; }
.lesson-break-list > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.62rem 0.7rem;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}
.lesson-break-list strong,
.lesson-break-list small { display: block; }
.lesson-break-list small { margin-top: 0.12rem; color: var(--muted); }
.lesson-break-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lesson-break-form > :last-child,
.lesson-break-form > .errorlist { grid-column: 1 / -1; }
.lesson-break-history { margin-top: 0.2rem; }
@media (max-width: 760px) {
    .study-duplicate-notice { align-items: stretch; flex-direction: column; }
    .study-duplicate-notice .compact-actions { justify-content: flex-start; }
    .lesson-break-list > li,
    .lesson-break-form { grid-template-columns: 1fr; }
    .lesson-break-form > :last-child,
    .lesson-break-form > .errorlist { grid-column: 1; }
}
/* Dodomisol package 2a: navigation, disclosure and progress polish */
.student-calendar-action-grid > .inline-details + .inline-details {
    margin-top: 0;
}

.authenticated-submenu > summary::after,
.profile-nav-trigger::after,
.study-area-card > summary::after,
.study-item-card > summary::after,
.submission-card > summary::after,
.topic-detail-card > summary::after,
.topic-edit-card > summary::after,
.inline-details > summary::before {
    content: "";
    display: inline-block;
    width: 0.44rem;
    height: 0.44rem;
    flex: 0 0 0.44rem;
    border: 0;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    border-radius: 0;
    background: transparent;
    color: currentColor;
    transform: rotate(45deg);
    transition: transform 180ms ease, color 180ms ease;
}

.authenticated-submenu[open] > summary::after,
.profile-nav-menu[open] > summary::after,
.study-area-card[open] > summary::after,
.study-item-card[open] > summary::after,
.submission-card[open] > summary::after,
.topic-detail-card[open] > summary::after,
.topic-edit-card[open] > summary::after,
.inline-details[open] > summary::before {
    background: transparent;
    color: var(--gold);
    transform: rotate(225deg);
}

.study-area-card > summary::after,
.study-item-card > summary::after,
.submission-card > summary::after,
.topic-detail-card > summary::after,
.topic-edit-card > summary::after {
    order: -1;
    margin: 0 0.18rem 0 0;
}

.inline-details > summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    list-style: none;
}

.inline-details > summary::-webkit-details-marker {
    display: none;
}

.notification-trigger {
    width: 2.15rem;
    height: 2.15rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    line-height: 1;
}

.notification-trigger:hover,
.notification-menu[open] .notification-trigger {
    border-color: transparent;
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.notification-trigger .bell-icon {
    display: block;
    margin: 0;
}

.profile-menu-danger,
.mobile-tabbar-panel .mobile-menu-danger {
    color: color-mix(in srgb, var(--rose) 78%, white);
}

.profile-nav-panel .profile-menu-danger:hover,
.mobile-tabbar-panel .mobile-menu-danger:hover {
    background: color-mix(in srgb, var(--rose) 13%, transparent);
    color: color-mix(in srgb, var(--rose) 88%, white);
}

.signup-request-actions {
    align-items: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.signup-approval-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.signup-approval-field {
    display: grid;
    gap: 0.18rem;
}

.signup-approval-field > span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.signup-approval-field select {
    min-width: 9.5rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem;
}

.signup-limited-note {
    align-self: center;
    max-width: 28rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.signup-limited-note strong {
    color: var(--text);
}

@media (max-width: 759px) {
    .signup-approval-form { width: 100%; }
    .signup-approval-field { flex: 1 1 8.5rem; }
    .signup-approval-field select { width: 100%; min-width: 0; }
}

.theme-symbol-action {
    justify-content: center;
}

.theme-menu-symbol,
.mobile-theme-symbol [data-theme-icon] {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    color: var(--gold);
    font-size: 1rem;
    line-height: 1;
}

.gear-icon {
    border: 1.7px solid currentColor;
    border-radius: 50%;
    box-shadow: 0 -0.33rem 0 -0.24rem currentColor, 0 0.33rem 0 -0.24rem currentColor, 0.33rem 0 0 -0.24rem currentColor, -0.33rem 0 0 -0.24rem currentColor;
}

.gear-icon::before {
    content: "";
    position: absolute;
    inset: 0.2rem;
    border: 1.4px solid currentColor;
    border-radius: 50%;
}

#configuracoes {
    scroll-margin-top: 5.5rem;
}

.profile-link-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.duo-progress > span,
.duo-progress > i {
    transition: width 920ms cubic-bezier(.2, .72, .18, 1), background-color 300ms ease;
}

@media (prefers-reduced-motion: reduce) {
    .duo-progress > span,
    .duo-progress > i {
        transition-duration: 1ms;
    }
}

/* Dodomisol package 2b: material resources, units and automatic progress */
.material-editor-stack,
.material-editor-list {
    display: grid;
    gap: 0.75rem;
}

.material-editor-panel,
.student-unit-editor-panel {
    border-radius: 14px;
}

.compact-material-form,
.compact-inline-editor {
    gap: 0.58rem;
}

.compact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.58rem;
    align-items: end;
}

.compact-form-grid-four {
    grid-template-columns: minmax(10rem, 1fr) minmax(13rem, 1.4fr) minmax(11rem, 1fr) 5rem;
}

.compact-form-grid-five {
    grid-template-columns: minmax(9rem, 1fr) 5rem minmax(12rem, 1.5fr) 5rem auto;
}

.material-editor-row {
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.material-editor-row > summary {
    min-height: 2.75rem;
    padding: 0.5rem 0.65rem;
}

.material-editor-row > summary span,
.material-editor-row > summary strong,
.material-editor-row > summary small {
    min-width: 0;
}

.material-editor-row > summary strong,
.material-editor-row > summary small {
    display: block;
}

.material-editor-row > summary small {
    color: var(--muted);
    font-size: 0.76rem;
}

.material-editor-row .compact-inline-editor {
    padding: 0.65rem;
    border-top: 1px solid var(--line);
}

.material-add-details {
    border-radius: 12px;
}

.material-unit-picker {
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem;
    border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--green) 5%, var(--surface));
}

.material-unit-choice-set {
    min-width: 0;
    border: 0;
    padding: 0;
    margin: 0;
}

.material-unit-choice-group {
    display: grid;
    gap: 0.35rem;
}

.material-unit-choice-group + .material-unit-choice-group {
    margin-top: 0.55rem;
}

.material-unit-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.35rem;
}

.material-unit-check-grid .check-row {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0.42rem 0.5rem;
    background: color-mix(in srgb, var(--surface-strong) 65%, transparent);
}

.student-unit-editor-list {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.student-unit-editor-row {
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.student-unit-editor-row > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    min-height: 2.65rem;
    padding: 0.42rem 0.55rem;
    list-style: none;
    cursor: pointer;
}

.student-unit-editor-row > summary::-webkit-details-marker {
    display: none;
}

.student-unit-editor-row > summary small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.student-unit-editor-body {
    padding: 0.6rem;
    border-top: 1px solid var(--line);
}

.automatic-progress-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.65rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--green) 6%, transparent);
}

.automatic-progress-summary .duo-progress,
.automatic-progress-summary small {
    grid-column: 1 / -1;
}

.compact-automatic-progress {
    max-width: 34rem;
}

.compact-automatic-progress .button {
    justify-self: start;
}

.study-unit-summary {
    display: grid;
    gap: 0.3rem;
    max-width: 44rem;
    padding: 0.45rem;
    border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 58%, transparent);
}

.study-unit-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5.6rem, 9rem);
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
}

.study-unit-summary-row + .study-unit-summary-row {
    border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
    padding-top: 0.3rem;
}

.study-unit-summary-name,
.study-unit-progress {
    display: flex;
    min-width: 0;
    gap: 0.4rem;
    align-items: center;
}

.study-unit-summary-name strong,
.study-unit-summary-name small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.study-unit-summary-name small {
    color: var(--muted);
    font-size: 0.68rem;
}

.study-unit-state {
    display: inline-grid;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 1.25rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--green) 38%, var(--line));
    border-radius: 50%;
    color: var(--green);
    font-weight: 900;
}

.study-unit-progress {
    justify-content: flex-end;
}

.study-unit-progress small {
    min-width: 2.2rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-align: right;
}

.study-unit-progress .duo-progress {
    width: min(6rem, 18vw);
    height: 0.42rem;
}

.study-resource-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.45rem;
}

.study-resource-link {
    width: 100%;
    max-width: none;
    min-height: 4rem;
    gap: 0.72rem;
    padding: 0.62rem 0.72rem;
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.study-resource-copy {
    display: grid;
    min-width: 0;
    line-height: 1.08;
}

.study-resource-copy strong,
.study-resource-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.study-resource-copy strong {
    display: -webkit-box;
    font: inherit;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.study-resource-copy small {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.resource-kind-icon {
    position: relative;
    display: inline-grid;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    place-items: center;
}

.resource-kind-icon.resource-kind-drive {
    width: 1.08rem;
    height: 0.98rem;
    clip-path: polygon(42% 0, 58% 0, 100% 78%, 91% 100%, 11% 100%, 0 78%);
    background: conic-gradient(from 32deg at 50% 58%, #1a73e8 0 33%, #34a853 0 66%, #fbbc04 0 100%);
}

.resource-kind-icon.resource-kind-youtube {
    width: 1.15rem;
    border-radius: 0.3rem;
    background: #ff4c55;
}

.resource-kind-icon.resource-kind-youtube::after {
    content: "";
    border-top: 0.25rem solid transparent;
    border-bottom: 0.25rem solid transparent;
    border-left: 0.38rem solid white;
    transform: translateX(0.04rem);
}

.resource-kind-icon.resource-kind-arquivo {
    width: 2rem;
    height: 2.28rem;
    flex: 0 0 2rem;
    border: 1.6px solid currentColor;
    border-radius: 0.3rem;
    color: var(--cyan);
    background: color-mix(in srgb, currentColor 7%, transparent);
}

.resource-kind-icon.resource-kind-arquivo::before {
    position: absolute;
    top: -1.6px;
    right: -1.6px;
    width: 0.62rem;
    height: 0.62rem;
    border-bottom: 1.6px solid currentColor;
    border-left: 1.6px solid currentColor;
    border-radius: 0 0 0 0.18rem;
    background: var(--surface-strong);
    content: "";
}

.resource-kind-icon.resource-kind-arquivo::after {
    position: absolute;
    right: 0.16rem;
    bottom: 0.28rem;
    left: 0.16rem;
    overflow: hidden;
    content: attr(data-file-label);
    font-size: 0.43rem;
    font-weight: 950;
    line-height: 1;
    text-align: center;
    text-overflow: clip;
    text-transform: uppercase;
    white-space: nowrap;
}

.resource-kind-icon.resource-file-pdf { color: #ff7587; }
.resource-kind-icon.resource-file-audio { color: #61d6bd; }
.resource-kind-icon.resource-file-video { color: #b89cff; }
.resource-kind-icon.resource-file-imagem { color: #73b9ff; }
.resource-kind-icon.resource-file-documento { color: #77a9ff; }
.resource-kind-icon.resource-file-planilha { color: #68d58e; }
.resource-kind-icon.resource-file-apresentacao { color: #ff9a67; }
.resource-kind-icon.resource-file-partitura { color: var(--gold-strong); }
.resource-kind-icon.resource-file-compactado { color: #c5a3ff; }

.resource-kind-icon.resource-kind-link::before {
    content: "↗";
    color: var(--cyan);
    font-size: 0.95rem;
    font-weight: 900;
}

.duo-progress > span,
.duo-progress > i {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
}

.duo-progress.progress-level-1 > span,
.duo-progress.progress-level-1 > i {
    background: linear-gradient(90deg, #ff8a8a, #e45050);
}

.duo-progress.progress-level-2 > span,
.duo-progress.progress-level-2 > i {
    background: linear-gradient(90deg, #ffd36a, #f4b321);
}

.duo-progress.progress-level-3 > span,
.duo-progress.progress-level-3 > i {
    background: linear-gradient(90deg, #65d6c2, #27a892);
}

.duo-progress.progress-level-4 > span,
.duo-progress.progress-level-4 > i {
    background: linear-gradient(90deg, #58e89b, #20b875);
}

.material-library-card-multi {
    align-items: start;
}

.material-library-card-multi .study-resource-list {
    margin-top: 0.4rem;
}

@media (max-width: 820px) {
    .compact-form-grid,
    .compact-form-grid-four,
    .compact-form-grid-five {
        grid-template-columns: 1fr;
    }

    .compact-form-grid-four .field-stack,
    .compact-form-grid-five .field-stack {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .material-editor-stack {
        gap: 0.6rem;
    }

    .material-unit-check-grid {
        grid-template-columns: 1fr;
    }

    .study-unit-summary-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .study-unit-progress {
        justify-content: flex-start;
        padding-left: 1.65rem;
    }

    .study-unit-progress .duo-progress {
        width: min(12rem, 62vw);
    }

    .student-unit-editor-row > summary {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Dodomisol materials: simple global library and student-specific plan */
.material-bank-page,
.material-bank-list,
.material-sort-list,
.material-section-list,
.material-item-list,
.inline-section-list,
.inline-item-list {
    display: grid;
    gap: 0.65rem;
}

/* Study periods and progress history */
.study-period-banner,
.current-period-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
    border-radius: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--gold) 11%, transparent), transparent 66%),
        var(--bg-soft);
}

.study-period-banner h3,
.current-period-card h2 {
    margin: 3px 0 6px;
}

.study-period-banner p,
.current-period-card p {
    margin: 0;
}

.study-period-banner small,
.current-period-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.compact-period-banner {
    margin-bottom: 18px;
    padding: 14px 16px;
}

.study-progress-page {
    display: grid;
    gap: 18px;
}

.progress-page-hero {
    padding-bottom: 8px;
}

.study-progress-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.progress-summary-card {
    display: grid;
    gap: 5px;
    min-height: 134px;
    align-content: center;
}

.progress-summary-card > span,
.progress-summary-card > small {
    color: var(--muted);
}

.progress-summary-card > strong {
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1;
}

.progress-summary-card.is-primary {
    border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
    background:
        radial-gradient(circle at 86% 16%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 38%),
        var(--surface);
}

.progress-chart-panel {
    overflow: hidden;
}

.progress-heading {
    align-items: flex-start;
}

.chart-mode-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-soft);
}

.chart-mode-switch button {
    min-height: 34px;
    padding: 6px 13px;
    border: 0;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.chart-mode-switch button.is-active {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
}

.progress-filter-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 8px;
}

.progress-filter-form label {
    display: grid;
    gap: 5px;
    min-width: 170px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
}

.progress-filter-form select {
    min-height: 40px;
}

.study-chart {
    margin-top: 10px;
}

.study-chart[hidden] {
    display: none;
}

.study-chart svg {
    display: block;
    width: 100%;
    min-height: 220px;
    overflow: visible;
}

.chart-grid line {
    stroke: color-mix(in srgb, var(--line) 75%, transparent);
    stroke-width: 1;
    stroke-dasharray: 5 7;
}

.chart-line {
    fill: none;
    stroke: var(--gold);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 5px 10px color-mix(in srgb, var(--gold) 25%, transparent));
}

.chart-line.completed-line {
    stroke: var(--green);
}

.chart-point {
    fill: var(--surface);
    stroke: var(--gold);
    stroke-width: 4;
}

.chart-point.completed-point {
    stroke: var(--green);
}

.chart-label {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.chart-caption {
    margin: 0;
    color: var(--muted);
    text-align: center;
    font-size: .85rem;
}

.progress-history-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-top: 8px;
}

.progress-history-heading h2 {
    margin: 4px 0 0;
}

.study-period-history {
    display: grid;
    gap: 10px;
}

.study-period-history-row {
    padding: 0;
    overflow: hidden;
}

.study-period-history-row > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 82px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
}

.study-period-history-row > summary::-webkit-details-marker {
    display: none;
}

.study-period-history-row > summary > span:first-child {
    display: grid;
    gap: 4px;
}

.study-period-history-row > summary small {
    color: var(--muted);
}

.period-summary-metrics {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: .86rem;
}

.period-summary-metrics > span:not(.status-chip) {
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--bg-soft);
}

.study-period-history-body {
    display: grid;
    gap: 16px;
    padding: 0 18px 18px;
    border-top: 1px solid var(--line);
}

.partial-history-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    background: var(--bg-soft);
    font-size: .86rem;
}

.period-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.period-detail-stats span {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    font-size: .82rem;
}

.period-detail-stats strong {
    color: var(--text);
    font-size: 1rem;
}

.period-goal-list,
.period-event-list {
    display: grid;
    gap: 8px;
}

.period-goal-list h3,
.period-event-list h3 {
    margin: 0 0 2px;
    font-size: .95rem;
}

.period-goal-list article,
.period-event-list article {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
}

.period-attachment-list {
    display: grid;
    gap: 10px;
}

.period-attachment-list > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 10px;
}

.period-attachment-list a {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 0.78rem;
    text-decoration: none;
}

.period-attachment-list img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-soft);
}

.period-goal-list article > div,
.period-event-list article > div {
    display: grid;
    flex: 1;
    gap: 2px;
}

.period-goal-list article > span:last-child,
.period-event-list article > span:last-child {
    white-space: nowrap;
    font-weight: 800;
}

.period-goal-list small,
.period-event-list small {
    color: var(--muted);
}

.event-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 15%, transparent);
}

.compact-empty-state {
    min-height: 120px;
    align-content: center;
}

@media (max-width: 720px) {
    .study-period-banner,
    .current-period-card {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .study-progress-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .progress-summary-card {
        min-height: 112px;
        padding: 12px 10px;
    }

    .progress-summary-card > strong {
        font-size: 1.8rem;
    }

    .progress-summary-card > span,
    .progress-summary-card > small {
        font-size: .72rem;
    }

    .progress-heading {
        gap: 12px;
    }

    .chart-mode-switch {
        width: 100%;
    }

    .chart-mode-switch button {
        flex: 1;
    }

    .progress-filter-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .progress-filter-form label {
        min-width: 0;
    }

    .progress-filter-form .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .study-chart {
        overflow-x: auto;
    }

    .study-chart svg {
        min-width: 560px;
    }

    .study-period-history-row > summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
        min-height: 0;
        padding: 14px;
    }

    .period-summary-metrics {
        justify-content: flex-start;
    }

    .study-period-history-body {
        padding: 0 14px 14px;
    }

    .period-detail-stats {
        grid-template-columns: 1fr;
    }

    .period-goal-list article,
    .period-event-list article {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .progress-page-hero .teacher-hero-row {
        align-items: flex-start;
    }
}

.material-bank-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.material-bank-tabs a {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    min-height: 2.45rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 850;
    text-decoration: none;
}

.material-bank-tabs a span {
    display: inline-grid;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    color: var(--text);
    font-size: 0.72rem;
}

.material-bank-tabs a.is-active {
    border-color: color-mix(in srgb, var(--amber) 65%, var(--line));
    background: color-mix(in srgb, var(--amber) 12%, var(--surface));
    color: var(--text);
}

.material-archive-note,
.material-archived-banner,
.student-specific-explanation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.material-archive-note span,
.material-archived-banner p {
    margin: 0;
    color: var(--muted);
}

.material-archived-banner {
    justify-content: space-between;
}

.material-bank-title-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.material-bank-row.is-archived {
    opacity: 0.88;
}

.material-archive-action {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}

.material-archive-action small {
    max-width: 45rem;
    color: var(--muted);
}

.paperclip-icon {
    position: relative;
    display: inline-block;
    width: 0.7rem;
    height: 1.05rem;
    flex: 0 0 0.7rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 0.5rem;
    color: var(--cyan);
    transform: rotate(38deg);
}

.paperclip-icon::after {
    content: "";
    position: absolute;
    inset: 0.12rem 0.1rem 0.14rem 0.12rem;
    border: 1px solid currentColor;
    border-top-color: transparent;
    border-radius: 0.4rem;
}

.material-sort-card,
.material-section-card {
    position: relative;
    min-width: 0;
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    transition: transform 180ms cubic-bezier(.2, .8, .2, 1), border-color 180ms ease, box-shadow 180ms ease;
}

.material-sort-card-head,
.material-section-head,
.material-item-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
    padding: 0.58rem 0.7rem;
}

.material-section-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    background: color-mix(in srgb, var(--cyan) 5%, transparent);
}

.material-section-head > span strong,
.material-section-head > span small,
.material-sort-title strong,
.material-sort-title small {
    display: block;
    min-width: 0;
}

.material-section-head small,
.material-sort-title small {
    color: var(--muted);
    font-size: 0.72rem;
}

.drag-grip {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: grab;
    touch-action: none;
}

.drag-grip > span {
    width: 0.85rem;
    height: 1.2rem;
    background: radial-gradient(circle, currentColor 0 1.5px, transparent 1.7px) 0 0 / 0.42rem 0.42rem;
}

.drag-grip:hover,
.drag-grip:focus-visible {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    color: var(--text);
}

.drag-grip.is-small {
    width: 1.65rem;
    height: 1.65rem;
}

.drag-grip.is-static {
    cursor: default;
    opacity: 0.45;
}

.is-material-sorting {
    user-select: none;
}

[data-sort-item].is-dragging {
    z-index: 3;
    border-color: color-mix(in srgb, var(--cyan) 70%, var(--line));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    transform: translateY(-3px) scale(1.008);
}

.material-sort-list.is-saving-order,
.material-section-list.is-saving-order,
.material-item-list.is-saving-order {
    pointer-events: none;
    opacity: 0.78;
}

.sort-accessible-actions {
    display: flex;
    gap: 0.18rem;
}

.sort-accessible-actions button {
    padding: 0.2rem 0.35rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.66rem;
    text-decoration: underline;
    text-underline-offset: 0.16rem;
    cursor: pointer;
}

.sort-accessible-actions button:disabled {
    visibility: hidden;
}

.material-inline-editor,
.material-delete-row {
    margin: 0 0.7rem 0.55rem;
}

.material-inline-editor > summary {
    min-height: 2rem;
    padding: 0.3rem 0.5rem;
    color: var(--muted);
    font-size: 0.74rem;
}

.material-delete-row {
    display: flex;
    justify-content: flex-end;
}

.material-add-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.material-content-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.material-section-card {
    padding-bottom: 0.55rem;
}

.material-item-list {
    margin: 0.55rem 0.7rem;
}

.material-item-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    padding: 0.42rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
}

.material-item-row > .material-inline-editor {
    margin: 0;
}

.material-item-row > form:last-child {
    display: flex;
}

.numbered-list-preview,
[data-inline-numbered-preview] {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--cyan) 7%, transparent);
    color: var(--muted);
    font-size: 0.76rem;
}

.material-danger-zone {
    border-color: color-mix(in srgb, #ff6b6b 45%, var(--line));
    background: color-mix(in srgb, #ff6b6b 5%, var(--surface));
}

.material-usage-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.material-usage-student {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.48rem;
    padding: 0.3rem 0.58rem 0.3rem 0.32rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.material-usage-student:hover,
.material-usage-student:focus-visible {
    border-color: color-mix(in srgb, var(--cyan) 55%, var(--line));
    background: color-mix(in srgb, var(--cyan) 8%, var(--surface));
}

.material-usage-student .avatar {
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
}

.material-usage-student .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-usage-student > span:last-child {
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-delete-confirm {
    max-width: 32rem;
}

.youtube-lazy-card {
    position: relative;
    display: grid;
    width: min(100%, 42rem);
    aspect-ratio: 16 / 9;
    margin: 0.25rem 0.7rem 0.65rem;
    overflow: hidden;
    place-items: center;
    border: 1px solid color-mix(in srgb, #ff4c55 35%, var(--line));
    border-radius: 12px;
    background: radial-gradient(circle at center, rgba(255, 76, 85, 0.15), rgba(6, 8, 12, 0.92));
}

.youtube-lazy-card.is-compact {
    width: min(100%, 34rem);
    margin: 0.35rem 0 0;
}

.youtube-lazy-card button {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid color-mix(in srgb, #ff4c55 55%, var(--line));
    border-radius: 999px;
    background: rgba(7, 8, 10, 0.84);
    color: #fff;
    font-weight: 850;
    cursor: pointer;
}

.youtube-lazy-card iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.study-resource-entry {
    max-width: min(100%, 34rem);
}

.inline-material-builder,
.progress-settings-card,
.focus-create-block {
    display: grid;
    gap: 0.55rem;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-strong) 55%, transparent);
}

.new-material-fields {
    display: grid;
    gap: 0.7rem;
}

.new-material-offer {
    margin: 0.35rem 0 0;
    color: var(--cyan);
    font-size: 0.8rem;
}

.inline-resource-links,
.inline-section-card,
.inline-numbered-builder {
    display: grid;
    gap: 0.45rem;
}

.inline-resource-row {
    display: grid;
    grid-template-columns: minmax(8rem, 0.8fr) minmax(12rem, 1.5fr) auto;
    gap: 0.45rem;
}

.inline-section-card {
    padding: 0.6rem;
    border: 1px solid color-mix(in srgb, var(--cyan) 22%, var(--line));
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
}

.inline-section-head,
.inline-section-actions,
.automatic-picker-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: space-between;
}

.inline-section-head input {
    flex: 1 1 15rem;
    font-weight: 850;
}

.inline-item-row {
    display: grid;
    grid-template-columns: auto minmax(10rem, 1fr) auto auto;
    gap: 0.45rem;
    align-items: center;
}

.inline-item-select {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.7rem;
}

.inline-numbered-builder {
    grid-template-columns: minmax(9rem, 1fr) 5.5rem 5.5rem;
    padding: 0.55rem;
    border: 1px dashed var(--line);
    border-radius: 9px;
}

.inline-numbered-builder [data-inline-numbered-preview],
.inline-numbered-builder button {
    grid-column: 1 / -1;
}

.student-specific-strong {
    gap: 0.8rem;
    border: 2px solid color-mix(in srgb, var(--green) 38%, var(--line));
    background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

.student-specific-strong > p {
    margin: 0;
}

.progress-settings,
.progress-settings-card {
    display: grid;
    gap: 0.65rem;
}

.locked-progress-preview,
.simple-progress-control {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) auto;
    gap: 0.45rem 0.65rem;
    align-items: center;
}

.locked-progress-preview {
    grid-template-columns: auto minmax(8rem, 1fr) auto;
    padding: 0.55rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    opacity: 0.78;
}

.locked-progress-preview small {
    grid-column: 1 / -1;
    color: var(--muted);
}

.simple-progress-control input[type="range"],
.locked-progress-preview input[type="range"] {
    width: 100%;
    height: 0.55rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green) 0 var(--progress, 0%), color-mix(in srgb, var(--line) 85%, transparent) var(--progress, 0%) 100%);
    appearance: none;
}

.simple-progress-control input[type="range"]::-webkit-slider-thumb,
.locked-progress-preview input[type="range"]::-webkit-slider-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 60%, var(--line));
    appearance: none;
}

.simple-progress-control output,
.locked-progress-preview output {
    min-width: 3.2rem;
    color: var(--text);
    font-weight: 900;
    text-align: right;
}

.simple-progress-control .button {
    grid-column: 1 / -1;
    justify-self: start;
}

.progress-mode-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.progress-mode-choices legend {
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
    font-weight: 850;
}

.progress-mode-choices label {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.progress-mode-choices label:has(input:checked) {
    border-color: color-mix(in srgb, var(--green) 58%, var(--line));
    background: color-mix(in srgb, var(--green) 8%, transparent);
}

.automatic-item-picker,
.student-unit-section {
    display: grid;
    gap: 0.5rem;
}

.student-unit-section {
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.student-unit-editor-row {
    display: grid;
    gap: 0.45rem;
}

.student-unit-editor-body {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 12rem);
    gap: 0.5rem;
    align-items: center;
}

.focus-create-block > label:not(.check-row) {
    margin-top: 0.25rem;
    font-weight: 800;
}

.student-specific-explanation {
    margin: 0.7rem 0;
}

.simple-progress-inline {
    display: grid;
    gap: 0.35rem;
}

@media (max-width: 820px) {
    .material-add-action-grid,
    .material-content-actions,
    .progress-mode-choices {
        grid-template-columns: 1fr;
    }

    .material-sort-card-head,
    .material-section-head {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .material-section-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .material-sort-card-head .sort-accessible-actions,
    .material-section-head .sort-accessible-actions {
        grid-column: 2 / -1;
        justify-self: end;
    }

    .material-item-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .material-item-row .sort-accessible-actions,
    .material-item-row > .material-inline-editor {
        grid-column: 2 / -1;
    }

    .inline-item-row,
    .inline-resource-row,
    .student-unit-editor-body {
        grid-template-columns: 1fr;
    }

    .inline-item-row .drag-grip {
        display: none;
    }
}

@media (max-width: 560px) {
    .sort-accessible-actions {
        flex-wrap: wrap;
    }

    .inline-numbered-builder {
        grid-template-columns: 1fr 1fr;
    }

    .inline-numbered-builder [data-numbered-base] {
        grid-column: 1 / -1;
    }

    .youtube-lazy-card {
        margin-inline: 0.5rem;
    }
}

/* Planos e serviços */
.tag-icon {
    width: 0.82rem;
    height: 0.64rem;
    border: 1.6px solid currentColor;
    border-radius: 0.16rem 0.28rem 0.28rem 0.16rem;
    transform: rotate(-8deg);
}

.tag-icon::before {
    content: "";
    position: absolute;
    left: 0.12rem;
    top: 50%;
    width: 0.12rem;
    height: 0.12rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    transform: translateY(-50%);
}

.teaching-offers-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.teaching-offer-list {
    display: grid;
    gap: 0.7rem;
}

.teaching-offer-card {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
}

.teaching-offer-card.is-default {
    border-color: color-mix(in srgb, var(--gold) 70%, var(--line));
}

.teaching-offer-main,
.teaching-offer-title,
.student-plan-snapshot,
.student-plan-meta,
.archived-offer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.teaching-offer-main > div,
.student-plan-snapshot > div,
.archived-offer-row > span {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.teaching-offer-price {
    color: var(--gold);
    text-align: right;
    white-space: nowrap;
}

.teaching-offer-actions {
    margin-top: 0.2rem;
}

.billing-source-summary {
    display: grid;
    gap: 0.45rem;
    margin: 0.2rem 0 1rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--gold) 5%, transparent);
}

.billing-source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.billing-source-chips > span {
    display: grid;
    gap: 0.1rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}

.teaching-offer-form {
    position: sticky;
    top: 5.2rem;
    display: grid;
    gap: 0.7rem;
}

.teaching-offer-form h2 {
    margin: -0.25rem 0 0;
}

.teaching-offer-short-fields,
.student-plan-short-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.student-plan-short-fields {
    grid-template-columns: repeat(2, minmax(0, 9rem));
}

.teaching-offer-short-fields .compact-number-input,
.student-plan-short-fields .compact-number-input,
.signup-plan-adjustments-fields .compact-number-input {
    width: 100%;
    max-width: 7rem;
}

.archived-offers summary,
.student-plan-history summary {
    cursor: pointer;
    font-weight: 700;
}

.archived-offer-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.archived-offer-row {
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.student-plan-panel {
    display: grid;
    gap: 0.75rem;
}

.student-plan-snapshot {
    padding: 0.8rem;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.student-plan-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.88rem;
}

.student-plan-meta span + span::before {
    content: "·";
    margin-right: 0.65rem;
}

.student-plan-assignment-form {
    grid-template-columns: repeat(2, minmax(15rem, 1fr));
    align-items: end;
    width: min(52rem, 100%);
    max-width: none;
}

.student-plan-assignment-form > .field-stack:has(textarea),
.student-plan-assignment-form > .button,
.student-plan-assignment-form > .free-access-details {
    grid-column: 1 / -1;
}

.free-access-details {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.free-access-details summary {
    cursor: pointer;
    font-weight: 750;
}

.free-access-fields {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.55rem;
}

@media (max-width: 720px) {
    .student-plan-assignment-form {
        grid-template-columns: 1fr;
    }

    .student-plan-assignment-form > .field-stack:has(textarea),
    .student-plan-assignment-form > .button,
    .student-plan-assignment-form > .free-access-details {
        grid-column: 1;
    }
}

.form-section-divider {
    height: 1px;
    margin: 0.3rem 0;
    background: var(--line);
}

.form-section-help {
    margin-top: -0.35rem;
    color: var(--muted);
}

.signup-plan-field {
    min-width: 11rem;
}

.signup-request-row {
    align-items: stretch;
    flex-direction: column;
}

.signup-request-row .signup-request-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.72rem;
    width: 100%;
}

.signup-approval-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(8.5rem, 1fr));
    align-items: end;
    gap: 0.62rem;
    min-width: 0;
}

.signup-approval-form.is-limited {
    grid-template-columns: minmax(14rem, 0.8fr) minmax(18rem, 1.2fr);
}

.signup-approval-field,
.signup-approval-field select {
    min-width: 0;
    width: 100%;
}

.signup-approval-field select,
.signup-plan-adjustments-fields input,
.signup-plan-adjustments-fields select,
.signup-plan-adjustments-fields textarea {
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: color-mix(in srgb, var(--bg) 82%, var(--surface));
    color-scheme: dark;
    font: inherit;
}

.signup-approval-field select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.45rem;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 1.18rem) 50%,
        calc(100% - 0.82rem) 50%;
    background-size: 0.38rem 0.38rem, 0.38rem 0.38rem;
    background-repeat: no-repeat;
}

.signup-approval-field select:focus,
.signup-plan-adjustments-fields input:focus,
.signup-plan-adjustments-fields select:focus,
.signup-plan-adjustments-fields textarea:focus {
    border-color: var(--gold);
    outline: 2px solid color-mix(in srgb, var(--gold) 20%, transparent);
}

.signup-request-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    padding-top: 0.62rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.signup-request-buttons form {
    margin: 0;
}

.signup-request-buttons .button {
    min-height: 2.75rem;
}

.signup-plan-adjustments {
    grid-column: 1 / -1;
}

.signup-plan-adjustments {
    position: relative;
}

.signup-plan-adjustments > summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.signup-plan-adjustments-fields {
    position: static;
    width: 100%;
    display: grid;
    gap: 0.55rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: none;
}

.signup-plan-adjustments-fields label:not(.check-line) {
    display: grid;
    gap: 0.25rem;
}

@media (max-width: 900px) {
    .teaching-offers-layout {
        grid-template-columns: 1fr;
    }

    .teaching-offer-form {
        position: static;
    }
}

@media (max-width: 560px) {
    .teaching-offer-main,
    .student-plan-snapshot {
        align-items: flex-start;
    }

    .teaching-offer-main {
        display: grid;
    }

    .teaching-offer-price {
        text-align: left;
    }

    .teaching-offer-short-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teaching-offer-actions {
        align-items: stretch;
    }

    .teaching-offer-actions .button,
    .teaching-offer-actions form {
        flex: 1 1 auto;
    }

    .signup-plan-adjustments-fields {
        position: static;
        width: auto;
    }

    .signup-request-actions,
    .signup-approval-form {
        grid-template-columns: 1fr;
    }

    .signup-approval-form.is-limited {
        grid-template-columns: 1fr;
    }

    .signup-plan-adjustments {
        grid-column: 1;
    }

    .signup-request-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .signup-request-buttons form,
    .signup-request-buttons .button {
        width: 100%;
    }
}

/* Weekly image attachments - Package 2c */
.weekly-attachment-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.55rem;
    margin-top: 0.7rem;
    max-width: 38rem;
}

.weekly-attachment-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.weekly-attachment-preview {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--bg-soft);
    cursor: zoom-in;
}

.weekly-attachment-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease, filter 180ms ease;
}

.weekly-attachment-preview:hover img,
.weekly-attachment-preview:focus-visible img {
    transform: scale(1.035);
    filter: brightness(1.06);
}

.weekly-attachment-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    min-height: 2rem;
    padding: 0.25rem;
}

.weekly-attachment-actions small {
    min-width: 0;
    margin-right: auto;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-attachment-actions .icon-button {
    width: 1.75rem;
    height: 1.75rem;
    min-height: 1.75rem;
    border: 0;
    background: transparent;
}

.weekly-image-dropzone {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    min-height: 2.6rem;
    margin-top: 0.6rem;
    padding: 0.55rem 0.75rem;
    border: 1px dashed color-mix(in srgb, var(--gold) 55%, var(--line));
    border-radius: 0.55rem;
    background: color-mix(in srgb, var(--gold) 5%, var(--surface));
    color: var(--muted);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.weekly-image-dropzone:hover,
.weekly-image-dropzone:focus-visible,
.weekly-image-dropzone.is-dragging {
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 12%, var(--surface));
    color: var(--text);
    transform: translateY(-1px);
}

.weekly-image-dropzone.is-uploading {
    opacity: 0.62;
    pointer-events: none;
}

.weekly-image-dropzone.is-uploading .paperclip-line-icon {
    animation: sync-spin 700ms linear infinite;
}

.compact-dropzone {
    min-height: 2.15rem;
    padding: 0.38rem 0.6rem;
    font-size: 0.78rem;
}

.weekly-attachment-expiry-note {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.paperclip-line-icon,
.download-line-icon,
.trash-line-icon {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    color: currentColor;
}

.paperclip-line-icon::before {
    position: absolute;
    inset: 0.02rem 0.2rem 0.08rem;
    border: 1.7px solid currentColor;
    border-top-color: transparent;
    border-radius: 0.52rem;
    content: "";
    transform: rotate(38deg);
}

.paperclip-line-icon::after {
    position: absolute;
    inset: 0.19rem 0.35rem 0.25rem;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 0.38rem;
    content: "";
    transform: rotate(38deg);
}

.download-line-icon::before {
    position: absolute;
    top: 0.05rem;
    left: 0.43rem;
    width: 0.16rem;
    height: 0.58rem;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.download-line-icon::after {
    position: absolute;
    left: 0.21rem;
    bottom: 0.08rem;
    width: 0.58rem;
    height: 0.58rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: rotate(45deg) translate(-0.08rem, -0.08rem);
}

.trash-line-icon::before {
    content: none;
}

.trash-line-icon::after {
    content: none;
}

.trash-line-icon {
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 11v6M14 11v6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 11v6M14 11v6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 640px) {
    .weekly-attachment-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: none;
    }

    .weekly-image-dropzone {
        width: 100%;
        justify-content: center;
    }
}
/* Calendar and recess completion pass */
.calendar-day.is-rest {
    opacity: 1;
    background-color: color-mix(in srgb, var(--surface-strong) 74%, var(--bg));
    background-image: repeating-linear-gradient(
        135deg,
        color-mix(in srgb, var(--muted) 7%, transparent) 0 4px,
        transparent 4px 9px
    );
}

.calendar-day.is-holiday {
    background-color: color-mix(in srgb, var(--gold) 15%, var(--surface));
}

.calendar-day.is-break,
.teacher-week-day.is-break {
    background-color: color-mix(in srgb, var(--teal) 12%, var(--surface-strong));
    background-image: repeating-linear-gradient(
        135deg,
        color-mix(in srgb, var(--teal) 12%, transparent) 0 4px,
        transparent 4px 9px
    );
}

.calendar-day.is-break {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 28%, transparent);
}

.calendar-tag.break,
.break-label {
    color: color-mix(in srgb, var(--teal) 78%, white);
    font-weight: 850;
}

.calendar-tag.fee {
    padding: 0.08rem 0.26rem;
    border-color: color-mix(in srgb, var(--green) 22%, transparent);
    background: color-mix(in srgb, var(--green) 7%, transparent);
    color: color-mix(in srgb, var(--green) 58%, var(--muted));
    font-size: 0.64rem;
    font-weight: 700;
}

.calendar-legend .legend-break {
    background: color-mix(in srgb, var(--teal) 55%, var(--surface));
}

.break-note {
    border-left: 3px solid var(--teal);
}

.lesson-break-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.lesson-break-date-grid,
.lesson-break-notice-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.lesson-break-notice-group {
    min-width: 0;
    margin: 0;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 9px;
}

.lesson-break-notice-group legend {
    padding: 0 0.3rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.lesson-break-notice-input {
    width: 4.25rem;
    max-width: 100%;
}

.lesson-break-date-input {
    min-width: 0;
    width: 100%;
}

.compact-more-details {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.compact-more-details > summary {
    width: fit-content;
    padding: 0.28rem 0;
    color: var(--gold);
}

.compact-more-details[open] > summary {
    margin-bottom: 0.45rem;
}

.authenticated-submenu > summary::after,
.profile-nav-trigger::after,
.study-area-card > summary::after,
.study-item-card > summary::after,
.submission-card > summary::after,
.topic-detail-card > summary::after,
.topic-edit-card > summary::after,
.inline-details > summary::before {
    width: 0.52rem;
    height: 0.66rem;
    flex-basis: 0.52rem;
    border: 0;
    background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%, 32% 50%);
    transform: rotate(0deg);
    transform-origin: center;
}

.authenticated-submenu[open] > summary::after,
.profile-nav-menu[open] > summary::after,
.study-area-card[open] > summary::after,
.study-item-card[open] > summary::after,
.submission-card[open] > summary::after,
.topic-detail-card[open] > summary::after,
.topic-edit-card[open] > summary::after,
.inline-details[open] > summary::before {
    background: var(--gold);
    transform: rotate(90deg);
}

@media (max-width: 620px) {
    .lesson-break-date-grid,
    .lesson-break-notice-fields {
        grid-template-columns: 1fr;
    }
}

/* Student grid and visible theme controls */
.theme-symbol-action {
    justify-content: flex-start;
}

.students-icon::before {
    top: 0.08rem;
    left: 0.11rem;
    width: 0.25rem;
    height: 0.25rem;
    border: 0;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0.42rem 0 0 currentColor;
}

.students-icon::after {
    left: 0.1rem;
    bottom: 0.08rem;
    width: 0.28rem;
    height: 0.38rem;
    border: 0;
    border-radius: 60% 60% 30% 30%;
    background: currentColor;
    box-shadow: 0.42rem 0 0 currentColor;
}

.teacher-list-card.is-limited {
    border-left: 3px solid var(--rose);
    background: color-mix(in srgb, var(--rose) 5%, var(--surface));
}

.teacher-list-card.is-limited .teacher-list-main strong {
    color: color-mix(in srgb, var(--rose) 68%, var(--text));
}

.teacher-list.is-grid-view {
    gap: 1rem 0.7rem;
}

.teacher-list.is-grid-view .teacher-list-card {
    min-height: 0;
    padding: 0.45rem 0.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.teacher-list.is-grid-view .teacher-list-main span,
.teacher-list.is-grid-view .teacher-list-main small,
.teacher-list.is-grid-view .teacher-list-card > form {
    display: none;
}

.teacher-list.is-grid-view .teacher-list-card.is-limited .avatar {
    border: 2px solid var(--rose);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 15%, transparent);
}

@media (max-width: 640px) {
    .teacher-list.is-grid-view {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teacher-list.is-grid-view .teacher-list-avatar .avatar {
        width: 4.25rem;
        height: 4.25rem;
    }

    .teacher-list.is-grid-view .teacher-list-main strong {
        font-size: 0.86rem;
    }
}

.lesson-future-actions {
    align-items: center;
    flex-wrap: wrap;
}

.lesson-future-actions .button {
    min-width: 0;
}

.lesson-status-details {
    width: 100%;
    grid-column: 1 / -1;
}

.lesson-status-form {
    grid-template-columns: minmax(8rem, 11rem) minmax(12rem, 1fr) auto;
    align-items: end;
}

.lesson-status-form textarea {
    min-height: 4.2rem;
}

@media (max-width: 720px) {
    .lesson-status-form {
        grid-template-columns: 1fr;
    }
}

.calendar-grid .calendar-day.is-rest:not(.is-break):not(.is-outside) {
    background-color: color-mix(in srgb, var(--muted) 13%, var(--surface));
    background-image: repeating-linear-gradient(
        135deg,
        color-mix(in srgb, var(--muted) 11%, transparent) 0 4px,
        transparent 4px 9px
    );
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 20%, transparent);
}

.lesson-break-notice-fields .lesson-break-notice-input {
    width: 4.25rem;
    justify-self: start;
}

/* Materials follow-up: compact sections, reliable touch sorting and crisp navigation icons */
form input[type="number"] {
    width: min(100%, 9rem);
    max-width: 9rem;
    justify-self: start;
}

.compact-number-input {
    width: 6.5rem !important;
    max-width: 6.5rem !important;
}

.students-icon::before {
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: currentColor;
    box-shadow: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='7.5' cy='6.5' r='3'/%3E%3Ccircle cx='17' cy='7.5' r='2.5'/%3E%3Cpath d='M2 20c.2-4.2 2.3-6.5 5.5-6.5S12.8 15.8 13 20H2Z'/%3E%3Cpath d='M12.4 19.8c-.1-2.1-.7-3.9-1.8-5.1 1.2-1 2.7-1.6 4.4-1.6 3.5 0 5.8 2.4 6 6.7h-8.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='7.5' cy='6.5' r='3'/%3E%3Ccircle cx='17' cy='7.5' r='2.5'/%3E%3Cpath d='M2 20c.2-4.2 2.3-6.5 5.5-6.5S12.8 15.8 13 20H2Z'/%3E%3Cpath d='M12.4 19.8c-.1-2.1-.7-3.9-1.8-5.1 1.2-1 2.7-1.6 4.4-1.6 3.5 0 5.8 2.4 6 6.7h-8.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.students-icon::after {
    display: none;
}

.note-line-icon::before {
    content: "\2669";
    inset: 0;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: currentColor;
    font-family: "Segoe UI Symbol", "Noto Music", "Bravura Text", serif;
    font-size: 1.12rem;
    font-weight: 400;
    line-height: 1;
    transform: none;
}

.note-line-icon::after {
    display: none;
}

.material-editor-panel {
    padding: 0.9rem;
}

.material-section-card {
    padding: 0;
}

/* 2026-07 navigation, materials, progress and finance package */
.button-success {
    border-color: color-mix(in srgb, var(--green) 62%, var(--line));
    background: color-mix(in srgb, var(--green) 18%, var(--surface));
    color: color-mix(in srgb, var(--green) 88%, white);
}

.button-success:hover {
    background: color-mix(in srgb, var(--green) 28%, var(--surface));
}

.material-bank-filter-form {
    align-items: end;
}

.material-area-filters {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 0.32rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.material-area-filters legend {
    width: 100%;
    margin-bottom: 0.18rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.search-form .material-area-filter {
    width: auto;
    flex: 0 0 auto;
    cursor: pointer;
}

.material-area-filter input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.material-area-filter span {
    display: inline-flex;
    min-height: 1.9rem;
    align-items: center;
    padding: 0.25rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.material-area-filter.is-active span,
.material-area-filter:has(input:checked) span {
    border-color: color-mix(in srgb, var(--gold) 56%, var(--line));
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold);
}

.material-editor-panel {
    padding: 0.72rem 0.78rem;
}

.material-archive-action {
    justify-content: flex-end;
    text-align: right;
}

.material-archive-action small {
    flex-basis: 100%;
}

.material-add-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.material-add-action-grid > details > summary {
    min-height: 2.35rem;
}

.material-inline-name-button {
    display: block;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: text;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-item-name-edit-form {
    grid-template-columns: minmax(6rem, 1fr);
}

.edit-line-icon,
.link-line-icon {
    position: relative;
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 0.95rem;
}

.edit-line-icon::before {
    content: "";
    position: absolute;
    top: 0.12rem;
    left: 0.38rem;
    width: 0.24rem;
    height: 0.72rem;
    border: 1.6px solid currentColor;
    border-radius: 2px 2px 0 0;
    transform: rotate(42deg);
}

.link-line-icon::before,
.link-line-icon::after {
    content: "";
    position: absolute;
    width: 0.48rem;
    height: 0.28rem;
    border: 1.6px solid currentColor;
    border-radius: 999px;
    transform: rotate(-38deg);
}

.link-line-icon::before { top: 0.12rem; right: 0.05rem; }
.link-line-icon::after { bottom: 0.12rem; left: 0.05rem; }

.trash-line-icon {
    position: relative;
    display: block;
    margin: auto;
    transform: translateX(0);
}

.progress-settings-card,
.progress-settings,
.automatic-item-picker {
    gap: 0.48rem;
    padding: 0.58rem;
    border-radius: 10px;
}

.progress-settings-card .check-row,
.progress-settings .check-row {
    min-height: 1.9rem;
    font-size: 0.82rem;
}

.progress-settings-card input[type="checkbox"],
.progress-settings input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.progress-mode-choices label {
    min-height: 2.15rem;
    padding: 0.36rem 0.5rem;
    font-size: 0.8rem;
}

.simple-progress-control input[type="range"] {
    height: 0.42rem;
}

.automatic-picker-head,
.compact-action-row,
.compact-switch-row,
.bulk-progress-toolbar,
.compact-completed-check,
.bulk-unit-choice {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.automatic-picker-head {
    justify-content: space-between;
}

.compact-action-row {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.compact-switch-row,
.compact-completed-check,
.bulk-unit-choice {
    font-size: 0.74rem;
    font-weight: 800;
}

.bulk-progress-toolbar {
    justify-content: space-between;
    padding: 0.38rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--green) 32%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--green) 7%, transparent);
    font-size: 0.76rem;
}

.student-unit-editor-row {
    padding: 0.36rem 0.42rem;
}

.student-unit-editor-body {
    gap: 0.42rem;
}

.study-item-edit-panel,
.focus-editor-panel {
    width: 100%;
}

.offer-student-summary {
    margin-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.offer-student-summary > summary {
    display: flex;
    min-height: 2.3rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.offer-student-avatars {
    display: flex;
}

.offer-student-avatars i {
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    margin-left: -0.28rem;
    overflow: hidden;
    place-items: center;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--surface-strong);
    color: var(--gold);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 900;
}

.offer-student-avatars img { width: 100%; height: 100%; object-fit: cover; }
.offer-student-links { display: grid; gap: 0.24rem; padding-bottom: 0.5rem; }
.offer-student-links a { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0.44rem; border-radius: 6px; background: color-mix(in srgb, var(--surface-strong) 65%, transparent); text-decoration: none; font-size: 0.78rem; }
.offer-student-links small { color: var(--muted); }

.finance-page { display: grid; gap: 0.75rem; }
.finance-tabs { display: flex; width: fit-content; gap: 0.2rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.finance-tabs a { padding: 0.38rem 0.7rem; border-radius: 7px; color: var(--muted); font-size: 0.8rem; font-weight: 850; text-decoration: none; }
.finance-tabs a.is-active { background: color-mix(in srgb, var(--gold) 14%, var(--surface-strong)); color: var(--gold); }
.finance-month-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 0.55rem; align-items: center; }
.finance-month-nav strong { text-align: center; }
.finance-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.finance-summary-card { display: grid; gap: 0.18rem; min-height: 0; padding: 0.75rem; }
.finance-summary-card > span { color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.finance-summary-card > strong { font-size: clamp(1.35rem, 3vw, 2.05rem); }
.finance-summary-card small { color: var(--muted); font-size: 0.7rem; }
.finance-summary-card.is-received > strong { color: var(--green); }
.finance-summary-card.is-overdue > strong { color: var(--rose); }
.finance-chart-panel, .finance-detail-panel { padding: 0.78rem; }
.finance-filters { margin: 0.55rem 0; border: 1px solid var(--line); border-radius: 8px; }
.finance-filters > summary { padding: 0.42rem 0.55rem; cursor: pointer; color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.finance-filter-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; padding: 0 0.55rem 0.55rem; }
.finance-filter-groups fieldset { display: flex; flex-wrap: wrap; gap: 0.28rem; margin: 0; padding: 0; border: 0; }
.finance-filter-groups legend { width: 100%; margin-bottom: 0.2rem; font-size: 0.72rem; font-weight: 900; }
.finance-filter-groups label { display: inline-flex; align-items: center; gap: 0.28rem; padding: 0.24rem 0.38rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.7rem; }
.finance-filter-groups input { width: 0.86rem; height: 0.86rem; }
.finance-chart-wrap { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: 0.35rem; min-height: 17rem; margin-top: 0.65rem; }
.finance-y-axis { display: flex; flex-direction: column; justify-content: space-between; padding: 0 0 1.6rem; color: var(--muted); font-size: 0.64rem; text-align: right; }
.finance-chart { display: grid; grid-template-columns: repeat(12, minmax(1.7rem, 1fr)); gap: 0.34rem; align-items: end; min-width: 39rem; padding: 0.4rem 0.3rem 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 calc(50% - 1px), color-mix(in srgb, var(--line) 55%, transparent) 50% calc(50% + 1px), transparent calc(50% + 1px) 100%); }
.finance-chart-wrap { overflow-x: auto; }
.finance-chart-month { display: grid; height: 100%; min-height: 15.5rem; grid-template-rows: minmax(0, 1fr) 1.4rem; align-items: end; color: var(--muted); text-decoration: none; }
.finance-chart-month > a { font-size: 0.61rem; text-align: center; white-space: nowrap; }
.finance-chart-month.is-selected > a { color: var(--gold); }
.finance-chart-column { display: flex; width: min(1.55rem, 80%); min-height: 0.2rem; flex-direction: column-reverse; align-self: end; justify-self: center; overflow: hidden; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--line) 26%, transparent); transition: opacity 160ms ease; }
.finance-segment { display: block; min-height: 3px; flex-grow: var(--segment-value); cursor: help; }
.finance-segment.is-received_on_time { background: var(--green); }
.finance-segment.is-received_late { background: var(--gold); }
.finance-segment.is-received_previous { background: var(--blue); }
.finance-segment.is-received_estimated { background: var(--teal); }
.finance-segment.is-not_received { background: color-mix(in srgb, var(--rose) 62%, transparent); }
.finance-segment.is-forecast { background: color-mix(in srgb, var(--muted) 34%, var(--surface-strong)); }
.finance-chart-month.is-filtered-empty .finance-chart-column { opacity: 0.12; }
.finance-legend { display: flex; flex-wrap: wrap; gap: 0.42rem 0.75rem; margin-top: 0.55rem; color: var(--muted); font-size: 0.68rem; }
.finance-legend span::before { content: ""; display: inline-block; width: 0.62rem; height: 0.62rem; margin-right: 0.25rem; border-radius: 2px; vertical-align: -0.05rem; }
.finance-legend .is-received-on-time::before { background: var(--green); }
.finance-legend .is-received-late::before { background: var(--gold); }
.finance-legend .is-received-previous::before { background: var(--blue); }
.finance-legend .is-not-received::before { background: color-mix(in srgb, var(--rose) 62%, transparent); }
.finance-legend .is-forecast::before { background: color-mix(in srgb, var(--muted) 34%, var(--surface-strong)); }
.finance-detail-list { display: grid; gap: 0.28rem; }
.finance-detail-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, auto); gap: 0.65rem; align-items: center; padding: 0.48rem 0.58rem; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.finance-detail-row > span { display: grid; gap: 0.08rem; }
.finance-detail-row > span:last-child { text-align: right; }
.finance-detail-row small { color: var(--muted); font-size: 0.7rem; }
.finance-detail-row.is-not_received { border-color: color-mix(in srgb, var(--rose) 38%, var(--line)); }
.finance-detail-row.is-received_previous { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.finance-accessible-table { margin-top: 0.6rem; }
.finance-accessible-table > summary { cursor: pointer; color: var(--gold); font-size: 0.76rem; font-weight: 800; }
.finance-accessible-table table { width: 100%; margin-top: 0.45rem; border-collapse: collapse; font-size: 0.74rem; }
.finance-accessible-table th, .finance-accessible-table td { padding: 0.38rem; border-bottom: 1px solid var(--line); text-align: left; }

input[type="date"], input[type="month"] {
    width: 10.5rem;
    max-width: 100%;
    cursor: pointer;
}

@media (min-width: 760px) {
    .is-authenticated .site-header { gap: 0.42rem 0.7rem; padding: 0.42rem 0.8rem; }
    .is-authenticated .brand { gap: 0.32rem; }
    .is-authenticated .brand-logo-wrap { width: 1.82rem; height: 1.82rem; flex-basis: 1.82rem; }
    .is-authenticated .brand-wordmark { width: 5.55rem; }
    .is-authenticated .brand-text { display: grid; gap: 0; }
    .is-authenticated .brand small { margin-top: -0.08rem; font-size: 0.66rem; line-height: 1; }
    .authenticated-main-nav > a, .authenticated-submenu > summary { min-height: 2.05rem; padding: 0.28rem 0.38rem; font-size: 0.84rem; }
}

@media (max-width: 820px) {
    .material-add-action-grid, .finance-summary-grid, .finance-filter-groups { grid-template-columns: 1fr; }
    .finance-detail-row { grid-template-columns: 1fr; }
    .finance-detail-row > span:last-child { text-align: left; }
    .finance-month-nav { grid-template-columns: 1fr 1fr; }
    .finance-month-nav strong { grid-column: 1 / -1; grid-row: 1; }
    .finance-chart-wrap { grid-template-columns: 4.6rem minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .is-authenticated .site-header { padding-block: 0.36rem; }
    .is-authenticated .brand-logo-wrap { width: 1.72rem; height: 1.72rem; flex-basis: 1.72rem; }
    .is-authenticated .brand-wordmark { width: 5rem; }
    .is-authenticated .brand small { font-size: 0.65rem; }
    .material-editor-panel { padding: 0.55rem; }
    .automatic-picker-head, .bulk-progress-toolbar { align-items: flex-start; flex-direction: column; }
    .finance-page { gap: 0.55rem; }
    .finance-summary-card { padding: 0.62rem; }
    .finance-chart-wrap { grid-template-columns: 3.9rem minmax(0, 1fr); min-height: 14rem; }
    .finance-chart-month { min-height: 12.5rem; }
}

.material-section-head {
    display: grid;
    grid-template-columns: 1.65rem 1.45rem minmax(0, 1fr) 3rem 3.18rem 1.65rem;
    gap: 0.18rem;
    min-height: 2.5rem;
    align-items: center;
    padding: 0.2rem 0.3rem;
}

.material-section-toggle {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.material-section-toggle:hover,
.material-section-toggle:focus-visible {
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    color: var(--text);
}

.material-section-title,
.material-item-title {
    display: flex;
    min-width: 0;
    gap: 0.42rem;
    align-items: center;
}

.material-section-title strong,
.material-item-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-section-title small {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.section-toggle-chevron {
    display: block;
    width: 0.48rem;
    height: 0.48rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.12rem) rotate(45deg);
    transition: transform 150ms ease;
}

.material-section-toggle[aria-expanded="true"] .section-toggle-chevron {
    transform: translateY(0.12rem) rotate(225deg);
}

.material-name-edit-form {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    margin: 0;
}

.material-name-edit-form[hidden],
[data-inline-edit-display][hidden],
[data-inline-edit-start][hidden],
[data-inline-edit-confirm][hidden],
[data-inline-edit-cancel][hidden],
.material-action-placeholder[hidden] {
    display: none !important;
}

.material-name-edit-form input,
.material-name-edit-form select {
    width: 100%;
    min-width: 0;
    height: 1.78rem;
    padding: 0.18rem 0.42rem;
    font-size: 0.78rem;
}

.material-edit-actions {
    display: grid;
    width: 3.18rem;
    grid-template-columns: repeat(2, 1.5rem);
    gap: 0.18rem;
}

.material-action-button,
.material-action-placeholder {
    display: inline-grid;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    line-height: 1;
}

.material-action-button {
    cursor: pointer;
}

.material-action-button:hover,
.material-action-button:focus-visible {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    color: var(--gold);
}

.material-action-button.is-confirm {
    color: var(--cyan);
}

.material-action-button.is-danger {
    color: color-mix(in srgb, var(--rose) 82%, white);
}

.material-action-button.is-danger:hover,
.material-action-button.is-danger:focus-visible {
    border-color: color-mix(in srgb, var(--rose) 60%, var(--line));
    background: color-mix(in srgb, var(--rose) 10%, transparent);
    color: #ff8a8a;
}

.material-action-button .trash-line-icon {
    width: 0.88rem;
    height: 0.88rem;
}

.material-head-delete {
    display: grid;
    width: 1.65rem;
    margin: 0;
    place-items: center;
}

.material-section-card.is-editing > .material-section-head {
    border-color: color-mix(in srgb, var(--gold) 38%, var(--line));
}

.material-section-body {
    padding: 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.material-section-body[hidden] {
    display: none !important;
}

.material-item-list {
    display: block;
    margin: 0;
}

.material-item-row {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr) 3rem 3.18rem 1.65rem;
    gap: 0.18rem;
    min-height: 2.25rem;
    align-items: center;
    padding: 0.14rem 0.3rem;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    border-radius: 0;
    background: transparent;
}

.material-item-row:last-child {
    border-bottom: 0;
}

.material-item-title strong {
    font-size: 0.84rem;
}

.material-item-row .status-chip {
    padding: 0.12rem 0.3rem;
    font-size: 0.58rem;
}

.material-item-row .drag-grip.is-small {
    width: 1.45rem;
    height: 1.45rem;
}

.material-item-name-edit-form {
    grid-template-columns: minmax(6rem, 1fr) minmax(5.5rem, 0.42fr);
}

.material-item-row.is-editing {
    min-height: 2.45rem;
    background: color-mix(in srgb, var(--gold) 4%, transparent);
}

.sort-accessible-actions {
    display: grid;
    width: 3rem;
    grid-template-columns: repeat(2, 1.45rem);
    gap: 0.08rem;
}

.material-section-head > .sort-accessible-actions,
.material-item-row > .sort-accessible-actions {
    grid-column: auto;
    justify-self: auto;
}

.sort-accessible-actions button {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1;
    text-decoration: none;
}

.sort-accessible-actions button:disabled {
    visibility: visible;
    opacity: 0.2;
    cursor: default;
}

.sort-accessible-actions button:not(:disabled):hover,
.sort-accessible-actions button:not(:disabled):focus-visible {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    color: var(--text);
}

.compact-delete-button {
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--rose) 38%, var(--line));
    border-radius: 6px;
    background: color-mix(in srgb, var(--rose) 7%, transparent);
    color: color-mix(in srgb, var(--rose) 82%, white);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.compact-delete-button:hover,
.compact-delete-button:focus-visible {
    border-color: var(--rose);
    background: color-mix(in srgb, var(--rose) 15%, transparent);
}

.primary-action-details {
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
    background: color-mix(in srgb, var(--gold) 6%, transparent);
}

.material-content-actions {
    align-items: start;
}

.material-content-actions > .action-details {
    width: 100%;
    margin: 0;
    overflow: clip;
}

.material-content-actions > .action-details > summary {
    display: flex;
    width: 100%;
    min-height: 2.55rem;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.45rem 0.7rem;
    text-align: center;
}

.material-content-actions > .action-details[open] > summary {
    margin: 0;
    border-width: 0 0 1px;
    border-radius: 0;
}

.material-live-message {
    margin: 0 0 0.45rem;
    padding: 0.42rem 0.58rem;
    border: 1px solid color-mix(in srgb, var(--cyan) 42%, var(--line));
    border-radius: 7px;
    background: color-mix(in srgb, var(--cyan) 8%, transparent);
    color: var(--text);
    font-size: 0.76rem;
}

.material-live-message.is-error {
    border-color: color-mix(in srgb, var(--rose) 48%, var(--line));
    background: color-mix(in srgb, var(--rose) 8%, transparent);
}

.material-content-actions .account-form {
    gap: 0.45rem;
}

.material-resource-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.25rem;
    margin: 0 0.7rem 0.55rem;
}

.material-resource-actions .material-resource-editor,
.material-resource-actions .material-resource-delete {
    margin: 0;
}

.material-resource-actions .material-resource-editor > summary,
.material-resource-actions .material-resource-delete .icon-button {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    min-height: 0;
    box-sizing: border-box;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
}

.material-resource-actions .material-resource-editor[open] {
    flex: 1 1 auto;
}

.material-resource-actions .material-resource-editor[open] > summary {
    margin-left: auto;
}

.material-resource-actions .material-resource-editor > form {
    margin-top: 0.35rem;
}

.material-resource-actions .material-resource-delete {
    width: auto;
}

.material-resource-actions .material-resource-delete .icon-button {
    border-color: color-mix(in srgb, var(--rose) 44%, var(--line));
    color: var(--rose);
}

.inline-section-card {
    gap: 0;
    padding: 0;
    overflow: clip;
}

.inline-section-head {
    display: grid;
    grid-template-columns: 1.45rem minmax(0, 1fr) auto 1.5rem;
    gap: 0.22rem;
    align-items: center;
    padding: 0.28rem 0.36rem;
}

.inline-section-head input,
.study-item-create-form .inline-section-head > input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]) {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 1.9rem;
    box-sizing: border-box;
    padding: 0.22rem 0.42rem;
    font-size: 0.8rem;
    font-weight: 800;
}

.inline-section-count {
    color: var(--muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.inline-section-body {
    display: grid;
    gap: 0.3rem;
    padding: 0.32rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.inline-section-body[hidden],
.inline-quick-builder[hidden] {
    display: none !important;
}

.inline-item-list {
    display: grid;
    gap: 0;
}

.inline-item-row {
    display: grid;
    grid-template-columns: 1.45rem minmax(0, 1fr) auto 1.5rem;
    min-height: 2.25rem;
    gap: 0.22rem;
    align-items: center;
    padding: 0.12rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}

.inline-item-row > input,
.study-item-create-form .inline-item-row > input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]) {
    min-height: 0;
    height: 1.8rem;
    box-sizing: border-box;
    padding: 0.2rem 0.4rem;
    font-size: 0.76rem;
}

.inline-item-row input[type="text"],
.inline-item-row input:not([type]) {
    min-width: 0;
}

.inline-quick-builder {
    margin-top: 0.45rem;
}

.inline-quick-builder.inline-numbered-builder {
    grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) 6.5rem 6.5rem;
}

.inline-quick-builder.inline-numbered-builder [data-quick-section-title],
.inline-quick-builder.inline-numbered-builder [data-numbered-base] {
    grid-column: auto;
}

.inline-quick-item-builder {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
    gap: 0.45rem;
    padding: 0.55rem;
    border: 1px dashed var(--line);
    border-radius: 9px;
}

@media (max-width: 820px) {
    .mobile-tabbar-menu-teaching > .mobile-tabbar-panel {
        right: 0;
        left: auto;
        transform-origin: bottom right;
    }

    .inline-item-row {
        grid-template-columns: minmax(0, 1fr) auto 1.5rem;
    }

    .inline-item-row .drag-grip {
        display: none;
    }

    .inline-quick-builder.inline-numbered-builder {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .inline-quick-builder.inline-numbered-builder [data-quick-section-title],
    .inline-quick-builder.inline-numbered-builder [data-numbered-base] {
        grid-column: 1 / -1;
    }

    .inline-quick-item-builder {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .material-editor-panel {
        padding: 0.62rem;
    }

    .material-section-list,
    .material-sort-list {
        gap: 0.38rem;
    }

    .material-section-head {
        grid-template-columns: 1.45rem 1.35rem minmax(0, 1fr) 2.78rem 2.88rem 1.45rem;
        gap: 0.1rem;
        min-height: 2.35rem;
        padding: 0.16rem 0.22rem;
    }

    .material-section-body {
        padding: 0;
    }

    .material-item-row .status-chip {
        display: none;
    }

    .material-item-row {
        grid-template-columns: 1.45rem minmax(0, 1fr) 2.78rem 2.88rem 1.45rem;
        gap: 0.1rem;
        min-height: 2.25rem;
        padding: 0.12rem 0.22rem;
    }

    .material-section-head > .drag-grip,
    .material-item-row .drag-grip.is-small,
    .material-section-toggle,
    .material-action-button,
    .material-action-placeholder {
        width: 1.35rem;
        height: 1.35rem;
    }

    .material-head-delete {
        width: 1.45rem;
    }

    .sort-accessible-actions {
        width: 2.78rem;
        grid-template-columns: repeat(2, 1.34rem);
    }

    .sort-accessible-actions button {
        width: 1.34rem;
        height: 1.34rem;
    }

    .material-edit-actions {
        width: 2.88rem;
        grid-template-columns: repeat(2, 1.39rem);
        gap: 0.1rem;
    }

    .material-section-title {
        gap: 0.28rem;
    }

    .material-section-title small {
        font-size: 0.62rem;
    }

    .material-name-edit-form input,
    .material-name-edit-form select {
        height: 1.65rem;
        padding-inline: 0.3rem;
        font-size: 0.72rem;
    }

    .material-item-name-edit-form {
        grid-template-columns: minmax(4.8rem, 1fr) minmax(4.4rem, 0.55fr);
    }

    .material-add-action-grid,
    .material-content-actions {
        gap: 0.35rem;
        margin-top: 0.45rem;
    }

    .inline-section-head {
        grid-template-columns: 1.35rem minmax(0, 1fr) auto 1.35rem;
        gap: 0.14rem;
        padding: 0.22rem 0.28rem;
    }

    .inline-section-head input,
    .study-item-create-form .inline-section-head > input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]) {
        height: 1.72rem;
        padding-inline: 0.32rem;
        font-size: 0.72rem;
    }

    .inline-section-count {
        font-size: 0.62rem;
    }

    .inline-item-row {
        grid-template-columns: minmax(0, 1fr) auto 1.35rem;
        min-height: 2.2rem;
        gap: 0.14rem;
    }

    .inline-item-row > input,
    .study-item-create-form .inline-item-row > input:not([type="checkbox"]):not([type="range"]):not([type="hidden"]) {
        height: 1.7rem;
        font-size: 0.72rem;
    }
}

/* Contas, responsáveis e troca de perfil */
.profile-choice-grid {
    display: grid;
    gap: 0.7rem;
    max-width: 58rem;
    margin-inline: auto;
}

.profile-choice-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    margin: 0;
}

.profile-choice-card strong,
.profile-choice-card small {
    display: block;
}

.profile-choice-card small {
    margin-top: 0.16rem;
    color: var(--muted);
}

.access-choice-layout {
    display: grid;
    gap: 0.9rem;
    max-width: 64rem;
}

.access-choice-icon {
    display: inline-grid;
    width: 2.55rem;
    height: 2.55rem;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
    border-radius: 50%;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.access-choice-school {
    color: var(--teal);
    border-color: color-mix(in srgb, var(--teal) 48%, var(--line));
    background: color-mix(in srgb, var(--teal) 10%, var(--surface));
}

.access-choice-student {
    color: #66d6c6;
    border-color: color-mix(in srgb, #66d6c6 48%, var(--line));
    background: color-mix(in srgb, #66d6c6 10%, var(--surface));
}

.pending-access-panel,
.access-status-card {
    display: grid;
    gap: 0.8rem;
}

.pending-access-panel h2,
.pending-access-panel p,
.access-status-card h1,
.access-status-card p {
    margin-block: 0;
}

.access-status-card h1 {
    max-width: 22ch;
    margin-inline: auto;
    font-size: clamp(1.75rem, 5vw, 2.45rem);
    line-height: 1.08;
    text-transform: none;
}

.pending-access-list {
    display: grid;
    gap: 0.45rem;
}

.pending-access-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.pending-access-row strong,
.pending-access-row small {
    display: block;
}

.pending-access-row small {
    margin-top: 0.12rem;
    color: var(--muted);
}

.pending-access-correction {
    grid-column: 2 / -1;
}

.pending-access-correction summary {
    width: fit-content;
    cursor: pointer;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.pending-access-correction form {
    display: grid;
    grid-template-columns: minmax(11rem, 1fr) minmax(11rem, 1fr) auto;
    gap: 0.55rem;
    align-items: end;
    margin-top: 0.55rem;
}

.pending-access-correction label {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    font-size: 0.75rem;
}

.access-status-shell,
.access-entry-shell {
    display: grid;
    min-height: calc(100svh - var(--header-height, 5rem));
    padding: clamp(1rem, 4vw, 2.5rem);
    place-items: center;
}

.access-status-card,
.access-entry-card {
    width: min(100%, 47rem);
    margin: 0;
    text-align: center;
}

.access-status-card .pending-access-list {
    text-align: left;
}

.access-status-dodo,
.access-entry-dodo {
    justify-self: center;
}

.access-entry-card {
    display: grid;
    gap: 0.52rem;
    justify-items: center;
    padding: clamp(1.15rem, 3vw, 1.75rem);
}

.access-entry-card h1,
.access-entry-card p {
    margin: 0;
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-choice-form { margin: 0; }
.profile-choice-card:hover,
.profile-choice-card:focus-visible { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.profile-choice-copy { min-width: 0; }
.profile-choice-open { color: var(--gold); font-size: 0.78rem; font-weight: 850; }

.access-entry-card h1 {
    max-width: 32rem;
    font-size: clamp(1.35rem, 3.2vw, 2rem);
    line-height: 1.12;
    text-transform: none;
}

.access-entry-card > p:not(.eyebrow) {
    max-width: 34rem;
    color: var(--text);
    font-size: clamp(0.94rem, 2vw, 1.05rem);
}

.access-entry-card > small {
    max-width: 31rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.access-entry-loading {
    display: grid;
    width: min(19rem, 76vw);
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.28rem 0.48rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.access-entry-loading-symbol {
    display: inline-grid;
    width: 1.7rem;
    height: 1.7rem;
    grid-row: 1 / 3;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 52%, var(--line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 10%, transparent);
    color: var(--gold);
    font-family: "Bravura Text", "Noto Music", serif;
    font-size: 1.05rem;
    line-height: 1;
    animation: access-entry-note-loop 1.15s ease-in-out infinite;
}

.access-entry-loader {
    display: block;
    width: 100%;
    height: 0.3rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.access-entry-loader span {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #e77824, var(--teal));
    box-shadow: 0 0 0.6rem color-mix(in srgb, var(--teal) 42%, transparent);
    animation: access-entry-loading 1.2s cubic-bezier(.45, 0, .55, 1) infinite;
}

@keyframes access-entry-loading {
    from { opacity: 0.58; transform: translateX(-115%); }
    50% { opacity: 1; }
    to { opacity: 0.72; transform: translateX(265%); }
}

@keyframes access-entry-note-loop {
    0%, 100% { transform: translateY(0) rotate(-5deg) scale(1); }
    45% { transform: translateY(-0.2rem) rotate(5deg) scale(1.08); }
    70% { transform: translateY(-0.04rem) rotate(-2deg) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    .access-entry-loading-symbol,
    .access-entry-loader span {
        animation: none !important;
        transform: none !important;
    }

    .access-entry-loader span {
        width: 100%;
        opacity: 0.82;
    }
}

.access-request-more {
    display: grid;
    gap: 0.3rem;
    justify-items: center;
    padding: 0.65rem;
    color: var(--muted);
    text-align: center;
}

.access-request-more div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    justify-content: center;
}

.access-request-more a {
    color: var(--accent);
    font-weight: 800;
}

.access-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.access-type-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    min-height: 4.2rem;
    margin: 0;
    padding: 0.65rem;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.access-type-option:hover {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
    transform: translateY(-1px);
}

.access-type-option:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent);
}

.access-type-option input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.12rem;
    accent-color: var(--accent);
}

.access-type-option strong,
.access-type-option small {
    display: block;
}

.access-type-option small {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.access-request-summary,
.account-request-identity {
    display: grid;
    gap: 0.12rem;
    padding: 0.55rem 0.65rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.access-request-summary span,
.account-request-identity small {
    color: var(--muted);
    font-size: 0.75rem;
}

.active-access-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
    max-width: 12.5rem;
    padding: 0.28rem 0.48rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.active-access-chip > span:nth-child(2),
.active-access-chip strong,
.active-access-chip small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-access-chip strong {
    font-size: 0.66rem;
}

.active-access-chip small {
    color: var(--muted);
    font-size: 0.57rem;
}

.profile-current-access {
    display: grid;
    gap: 0.08rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--line);
}

.profile-current-access span,
.profile-current-access small {
    color: var(--muted);
    font-size: 0.68rem;
}

.verified-text {
    color: #66d6c6;
}

.warning-text {
    color: var(--accent);
}

.student-access-manager {
    display: grid;
    gap: 0.8rem;
}

.student-access-manager h2,
.student-access-manager p {
    margin-block: 0;
}

.student-access-list {
    display: grid;
    gap: 0.45rem;
}

.student-access-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.45fr) minmax(8rem, 0.7fr) minmax(10rem, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.student-access-row.has-other-relationship {
    grid-template-columns: minmax(12rem, 1.45fr) minmax(8rem, 0.7fr) minmax(8rem, 0.75fr) minmax(10rem, 1fr) auto;
}

.student-access-row.is-muted {
    opacity: 0.58;
}

.student-access-person,
.student-access-person strong,
.student-access-person small {
    min-width: 0;
}

.student-access-person strong,
.student-access-person small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-access-person small {
    color: var(--muted);
}

.student-access-row select,
.student-access-row input[type="text"] {
    min-width: 0;
    width: 100%;
}

.student-access-row .row-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

.compact-check {
    min-width: 0;
    margin: 0;
    font-size: 0.78rem;
}

.student-access-invite {
    border-top: 1px solid var(--line);
    padding-top: 0.7rem;
}

.student-access-invite summary {
    cursor: pointer;
    font-weight: 800;
}

.access-invite-form {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.copy-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
}

.student-authorized-list {
    display: grid;
    gap: 0.4rem;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.student-authorized-list p {
    margin: 0 0 0.1rem;
}

.student-authorized-person {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: baseline;
    padding-block: 0.3rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.student-authorized-person:last-of-type {
    border-bottom: 0;
}

.student-authorized-person small {
    color: var(--muted);
    text-align: right;
}

@media (max-width: 1100px) {
    .student-access-row {
        grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 0.7fr) minmax(8rem, 0.8fr);
    }

    .student-access-row .compact-check {
        grid-column: 1 / 3;
    }

    .student-access-row .row-actions {
        grid-column: 3;
    }
}

@media (max-width: 620px) {
    .is-authenticated .account-nav > .active-access-chip {
        display: grid;
    }

    .access-entry-page .student-hero h1 {
        font-size: 2rem;
        line-height: 1.05;
    }

    .access-status-card h1 {
        font-size: 1.8rem;
    }

    .profile-choice-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .profile-choice-open {
        grid-column: 3;
    }

    .access-type-grid,
    .pending-access-correction form {
        grid-template-columns: 1fr;
    }

    .pending-access-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pending-access-row > .status-chip,
    .pending-access-correction {
        grid-column: 2;
        justify-self: start;
    }

    .active-access-chip {
        max-width: 2.5rem;
        padding-inline: 0.42rem;
    }

    .active-access-chip > span:nth-child(2) {
        display: none;
    }

    .student-access-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .student-access-row .compact-check,
    .student-access-row .row-actions {
        grid-column: 1;
    }

    .student-access-row .row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-access-row .row-actions .button {
        width: 100%;
    }

    .copy-link-row,
    .student-authorized-person {
        grid-template-columns: 1fr;
    }

    .student-authorized-person small {
        text-align: left;
    }
}

/* Final precedence for the compact package. */
.material-item-name-edit-form {
    grid-template-columns: minmax(6rem, 1fr);
}

.finance-breakdown-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.finance-segment {
    appearance: none;
    border: 0;
    border-radius: 0;
    min-width: 0;
    padding: 0;
}

.finance-segment:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
    position: relative;
    z-index: 2;
}

.finance-chart-month > a {
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}

.finance-breakdown-summary > span {
    display: grid;
    gap: 0.04rem;
    padding: 0.3rem 0.42rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
    font-size: 0.7rem;
}

.finance-breakdown-summary small,
.individual-condition-note {
    color: var(--muted);
    font-size: 0.68rem;
}

/* 2026-07 review package: navigation, students and compact study controls */
.notification-trigger .bell-icon {
    transform: translateY(-0.1rem) scale(0.94);
}

.profile-nav-trigger {
    width: 2.2rem;
    height: 2.2rem;
    min-height: 2.2rem;
    justify-content: center;
    overflow: hidden;
    padding: 0.12rem;
    border-radius: 50%;
}

.profile-nav-trigger::after {
    display: none;
}

.profile-nav-avatar {
    display: inline-grid;
    width: 1.85rem;
    height: 1.85rem;
    overflow: hidden;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 13%, var(--surface-strong));
    color: var(--gold);
    font-size: 0.66rem;
    font-weight: 850;
    line-height: 1;
}

.profile-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-dual-icon {
    display: inline-flex;
    width: 1.8rem;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    color: var(--muted);
    line-height: 1;
}

.theme-dual-icon i {
    display: inline-grid;
    width: 0.78rem;
    height: 0.78rem;
    place-items: center;
    font-style: normal;
    transition: color 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.theme-sun::before { content: "\2600"; font-size: 0.82rem; }
.theme-moon::before { content: "\263E"; font-size: 0.86rem; }
.theme-dual-icon[data-current-theme="dark"] .theme-moon,
.theme-dual-icon[data-current-theme="light"] .theme-sun { color: var(--gold); opacity: 1; transform: scale(1.08); }
.theme-dual-icon[data-current-theme="dark"] .theme-sun,
.theme-dual-icon[data-current-theme="light"] .theme-moon { opacity: 0.5; transform: scale(0.88); }

.profile-nav-panel a,
.profile-nav-panel .profile-menu-action,
.mobile-tabbar-panel a,
.mobile-tabbar-panel button,
.authenticated-main-nav > a,
.authenticated-submenu > summary {
    font-weight: 600;
}

.profile-nav-panel .profile-menu-danger,
.mobile-tabbar-panel .mobile-menu-danger {
    color: color-mix(in srgb, var(--rose) 86%, white);
    font-weight: 750;
}

.home-icon::before {
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10.7 12 3l9 7.7v9.1c0 .7-.5 1.2-1.2 1.2h-5.1v-6.3H9.3V21H4.2C3.5 21 3 20.5 3 19.8v-9.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10.7 12 3l9 7.7v9.1c0 .7-.5 1.2-1.2 1.2h-5.1v-6.3H9.3V21H4.2C3.5 21 3 20.5 3 19.8v-9.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.home-icon::after { display: none; }
.note-line-icon::before { font-size: 1.28rem; transform: translateY(-0.06rem); }

.back-button {
    margin-top: 0.38rem;
    padding-block: 0.18rem;
    text-decoration: none;
}

.back-button + main > .teacher-hero.compact-hero {
    padding-top: 1.15rem;
}

.back-button + main > .teacher-hero.compact-hero + .teacher-section,
.back-button + main > .teacher-hero.compact-hero + .narrow-section {
    margin-top: 0.75rem;
}

input[type="date"],
input[type="month"],
input[type="time"],
input[type="datetime-local"] {
    max-width: 100%;
    cursor: pointer;
    color-scheme: dark;
}

input[type="date"], input[type="month"] { width: 10rem; }
input[type="time"] { width: 7.2rem; }

.split-datetime-control {
    display: grid;
    grid-template-columns: minmax(8.8rem, 10rem) minmax(6.4rem, 7.2rem);
    gap: 0.38rem;
    align-items: center;
}

.split-datetime-control input { width: 100%; }

.field-starts_at:has(> .split-date-input),
.field-ends_at:has(> .split-date-input),
.field-teacher_confirmed_paid_at:has(> .split-date-input) {
    grid-template-columns: minmax(8.8rem, 10rem) minmax(6.4rem, 7.2rem);
    gap: 0.25rem 0.38rem;
}
.field-starts_at:has(> .split-date-input) > label,
.field-ends_at:has(> .split-date-input) > label,
.field-teacher_confirmed_paid_at:has(> .split-date-input) > label,
.field-starts_at:has(> .split-date-input) > .errorlist,
.field-ends_at:has(> .split-date-input) > .errorlist,
.field-teacher_confirmed_paid_at:has(> .split-date-input) > .errorlist,
.field-starts_at:has(> .split-date-input) > .field-help,
.field-ends_at:has(> .split-date-input) > .field-help,
.field-teacher_confirmed_paid_at:has(> .split-date-input) > .field-help { grid-column: 1 / -1; }
.split-date-input,
.split-time-input { width: 100% !important; }

.student-live-search {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) auto;
    gap: 0.38rem 0.65rem;
    align-items: center;
}

.student-live-search > label:first-child { grid-column: 1 / -1; }
.search-input-shell { position: relative; min-width: 0; }
.search-input-shell input { width: 100%; padding-right: 2.2rem; }
.search-clear-button {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    display: inline-grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
    transform: translateY(-50%);
}
.search-clear-button:hover { background: var(--surface-strong); color: var(--text); }
.student-limited-filter { align-self: center; min-height: 2.35rem; margin: 0; white-space: nowrap; }
[data-student-card][hidden] { display: none !important; }

.teacher-list.is-grid-view .teacher-list-card {
    align-content: start;
    grid-template-rows: auto minmax(2.25rem, auto);
}

.teacher-list.is-grid-view .teacher-list-main {
    align-content: start;
}

.teacher-list.is-grid-view .teacher-list-main strong {
    align-self: start;
}

.relationship-inline { color: var(--gold); font-size: 0.86em; white-space: nowrap; }
.profile-summary > div > p { margin-block: 0.2rem; }
.profile-summary > div > p:first-of-type { margin-bottom: 0.55rem; }
.guardian-account-line { line-height: 1.45; }
.copyable-contact { display: inline-flex; align-items: baseline; gap: 0.16rem; }
.contact-copy-button {
    display: inline-grid;
    width: 1.25rem;
    height: 1.25rem;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    opacity: 0;
    vertical-align: baseline;
    transition: opacity 140ms ease, color 140ms ease;
}
.copyable-contact:hover .contact-copy-button,
.contact-copy-button:focus-visible,
.contact-copy-button.is-copied { opacity: 1; }
.contact-copy-button:hover,
.contact-copy-button.is-copied { color: var(--green); }
.copy-line-icon { position: relative; width: 0.72rem; height: 0.72rem; }
.copy-line-icon::before,
.copy-line-icon::after { content: ""; position: absolute; width: 0.45rem; height: 0.45rem; border: 1.3px solid currentColor; border-radius: 2px; }
.copy-line-icon::before { top: 0; right: 0; }
.copy-line-icon::after { bottom: 0; left: 0; background: var(--surface); }

.student-detail-actions .button { min-height: 2.7rem; }
.streak-active-toggle {
    padding: 0.38rem 0.52rem;
    border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--green) 8%, var(--surface));
}
.streak-active-toggle:has(input:checked) { color: color-mix(in srgb, var(--green) 82%, white); }

.lesson-series-compact-form,
.calendar-event-compact-form {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
}
.lesson-series-compact-form > .field-stack,
.calendar-event-compact-form > .field-stack { grid-column: span 4; }
.lesson-series-compact-form > .field-title { grid-column: 1 / span 5; }
.lesson-series-compact-form > .field-starts_on { grid-column: 6 / span 3; }
.lesson-series-compact-form > .field-start_time { grid-column: 9 / span 2; }
.lesson-series-compact-form > .field-duration_minutes { grid-column: 11 / span 2; }
.lesson-series-compact-form > .field-frequency { grid-column: 1 / span 4; }
.lesson-series-compact-form > .field-interval_days { grid-column: 5 / span 4; }
.lesson-series-compact-form > .field-mode { grid-column: 9 / span 4; }
.lesson-series-compact-form:not(.has-custom-frequency) > .field-mode { grid-column: 5 / span 4; }
.lesson-series-compact-form > .field-notes { grid-column: 1 / -1; }
.calendar-event-compact-form > .field-event_type { grid-column: span 3; }
.calendar-event-compact-form > .field-title { grid-column: span 5; }
.calendar-event-compact-form > .field-starts_at,
.calendar-event-compact-form > .field-ends_at { grid-column: span 6; }
.calendar-event-compact-form > .field-location { grid-column: span 4; }
.calendar-event-compact-form > .field-notes { grid-column: span 8; }
.lesson-series-compact-form > button,
.calendar-event-compact-form > button { grid-column: 1 / -1; justify-self: start; }
.lesson-series-compact-form input[type="number"] { width: 100%; }
.lesson-series-compact-form > .field-notes textarea { min-height: 5.25rem; }

.lesson-scheduler { display: grid; gap: .8rem; }
.lesson-scheduler > h2 { margin: 0; }
.lesson-schedule-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.lesson-schedule-options > label { position: relative; min-width: 0; cursor: pointer; }
.lesson-schedule-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lesson-schedule-options span {
    display: grid;
    gap: .16rem;
    min-height: 4.35rem;
    align-content: center;
    padding: .72rem .85rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--bg) 82%, var(--surface));
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.lesson-schedule-options small { color: var(--muted); }
.lesson-schedule-options label:hover span { border-color: color-mix(in srgb, var(--gold) 54%, var(--line)); transform: translateY(-1px); }
.lesson-schedule-options input:checked + span { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent); }
.lesson-schedule-options input:focus-visible + span { outline: 2px solid color-mix(in srgb, var(--gold) 38%, transparent); outline-offset: 2px; }
.lesson-schedule-panel { padding-top: .75rem; border-top: 1px solid var(--line); }
.lesson-one-off-form { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; }
.lesson-one-off-form > .field-stack { grid-column: span 4; }
.lesson-one-off-form > .field-starts_at { grid-column: span 6; }
.lesson-one-off-form > .field-duration_minutes,
.lesson-one-off-form > .field-mode { grid-column: span 3; }
.lesson-one-off-form > .field-student_summary { grid-column: 1 / -1; }
.lesson-one-off-form > button { grid-column: 1 / -1; justify-self: start; }
.lesson-one-off-form input[type="number"] { width: 100%; max-width: 6rem; }

.student-view-actions { display: flex; align-items: center; gap: 0.45rem; }
.student-preview-link {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
}
.student-preview-link:hover { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); color: var(--gold); }
.eye-line-icon { position: relative; display: inline-block; width: 1rem; height: 0.7rem; border: 1.6px solid currentColor; border-radius: 70% 0 70% 0; transform: rotate(45deg); }
.eye-line-icon::before { content: ""; position: absolute; inset: 50% auto auto 50%; width: 0.27rem; height: 0.27rem; border-radius: 50%; background: currentColor; transform: translate(-50%, -50%); }
.teacher-preview-banner {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem max(1rem, calc((100vw - 1120px) / 2));
    border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 95%, transparent);
    backdrop-filter: blur(12px);
}
.teacher-preview-banner > span { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--gold); font-size: 0.84rem; font-weight: 750; }
.teacher-preview-banner .teacher-preview-back { margin: 0; }

@media (max-width: 700px) {
    .study-resource-list {
        grid-template-columns: 1fr;
    }
}

.compact-period-banner .study-period-banner-heading,
.compact-period-banner .current-period-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}
.compact-period-banner .period-banner-main { flex: 1 1 auto; min-width: 0; }
.compact-period-banner .period-banner-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.compact-period-banner .period-banner-title span { color: var(--muted); font-size: 0.78rem; text-align: right; }
.compact-period-banner h3,
.compact-period-banner h2,
.compact-period-banner p { margin: 0; }

.study-area-card > summary {
    background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 11%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 76%, transparent));
}
.study-area-card[open] > summary { border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, var(--line)); }
.save-progress-action { margin-left: auto; border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); background: var(--gold); color: var(--on-gold); }
.study-item-create-shell > summary { color: var(--gold-strong); font-weight: 850; }
.progress-mode-choices legend { margin-bottom: 0.08rem; font-size: 0.76rem; font-weight: 600; }
.progress-mode-choices input[type="radio"] { width: 0.95rem; height: 0.95rem; }
.simple-progress-control input[type="range"] { --progress-color: var(--green); height: 0.32rem; background: linear-gradient(90deg, var(--progress-color) 0 var(--progress, 0%), color-mix(in srgb, var(--line) 85%, transparent) var(--progress, 0%) 100%); }
.simple-progress-control input.progress-level-1 { --progress-color: #e45050; }
.simple-progress-control input.progress-level-2 { --progress-color: #f4b321; }
.simple-progress-control input.progress-level-3 { --progress-color: #27a892; }
.simple-progress-control input.progress-level-4 { --progress-color: #20b875; }
.simple-progress-control input[type="range"]::-webkit-slider-thumb { width: 1rem; height: 1rem; border-width: 2px; background: var(--progress-color); }

.study-item-edit-panel { max-width: none; }
.study-item-edit-form { width: 100%; max-width: none; }
.student-unit-editor-list { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.student-unit-section { gap: 0; padding: 0; border: 0; border-radius: 0; }
.student-unit-section > strong { padding: 0.42rem 0.55rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 9%, var(--surface-strong)); font-size: 0.78rem; }
.student-unit-editor-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 2.35rem; align-items: center; gap: 0.55rem; padding: 0.26rem 0.5rem; border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.student-unit-editor-row:last-child { border-bottom: 0; }
.student-unit-editor-row.is-completed { background: color-mix(in srgb, var(--green) 5%, transparent); }
.student-unit-completion { min-width: 6.5rem; text-align: right; }
.unit-plan-choice { min-width: 0; margin: 0; }
.unit-plan-choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.billing-settings { width: 100%; grid-template-columns: minmax(9rem, 12rem) minmax(8rem, 10rem); justify-content: start; }
.billing-settings > .button { justify-self: start; }

@media (max-width: 820px) {
    .lesson-series-compact-form,
    .lesson-one-off-form,
    .calendar-event-compact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lesson-series-compact-form > .field-stack,
    .lesson-one-off-form > .field-stack,
    .calendar-event-compact-form > .field-stack { grid-column: span 1; }
    .lesson-series-compact-form > .field-title,
    .lesson-series-compact-form > .field-notes,
    .calendar-event-compact-form > .field-title,
    .calendar-event-compact-form > .field-notes,
    .calendar-event-compact-form > .field-starts_at,
    .calendar-event-compact-form > .field-ends_at,
    .lesson-one-off-form > .field-starts_at,
    .lesson-one-off-form > .field-student_summary,
    .lesson-one-off-form > button,
    .lesson-series-compact-form > button,
    .calendar-event-compact-form > button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .student-live-search,
    .lesson-series-compact-form,
    .lesson-one-off-form,
    .calendar-event-compact-form,
    .billing-settings { grid-template-columns: 1fr; }
    .student-live-search > *,
    .lesson-series-compact-form > .field-stack,
    .lesson-one-off-form > .field-stack,
    .calendar-event-compact-form > .field-stack,
    .lesson-series-compact-form > button,
    .lesson-one-off-form > button,
    .calendar-event-compact-form > button { grid-column: 1 / -1; }
    .student-limited-filter { white-space: normal; }
    .split-datetime-control { grid-template-columns: minmax(0, 1fr) 7.2rem; }
    .field-starts_at:has(> .split-date-input),
    .field-ends_at:has(> .split-date-input),
    .field-teacher_confirmed_paid_at:has(> .split-date-input) { grid-template-columns: minmax(0, 1fr) 7.2rem; }
    .teacher-preview-banner { position: relative; padding-inline: 0.75rem; }
    .student-unit-editor-row { grid-template-columns: minmax(0, 1fr); gap: 0.18rem; }
    .student-unit-completion { min-width: 0; padding-left: 1.45rem; text-align: left; }
    .copyable-contact .contact-copy-button { opacity: 0.75; }
    .lesson-schedule-options { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .material-item-name-edit-form {
        grid-template-columns: minmax(4.8rem, 1fr);
    }
}

/* 2026-07 navigation and management polish */
[data-live-filter-item][hidden],
[data-live-filter-container][hidden],
.live-filter-empty[hidden],
.finance-chart-month[hidden],
.finance-chart-tooltip[hidden] {
    display: none !important;
}

.live-filter-reset {
    justify-self: start;
    white-space: nowrap;
}

.material-bank-filter-form,
.teacher-live-filter-form {
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) auto;
    gap: 0.45rem 0.7rem;
    align-items: end;
}

.material-bank-filter-form > label,
.material-bank-filter-form > fieldset {
    grid-column: 1 / -1;
}

.material-bank-filter-form .live-filter-reset {
    grid-column: 1 / -1;
}

.material-archive-action {
    justify-content: flex-start;
    text-align: left;
}

.material-resource-editor > summary::before,
.material-resource-editor > summary::after {
    display: none !important;
}

.material-resource-add-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.material-resource-add-actions > details,
.material-resource-add-actions > details > summary {
    width: 100%;
}

.material-resource-add-actions > details > summary {
    min-height: 2.55rem;
    box-sizing: border-box;
    justify-content: center;
}

.material-resource-actions {
    align-items: flex-start;
}

.material-resource-actions .material-resource-editor:not([open]) {
    flex: 0 0 auto;
}

.material-content-actions > .action-details {
    border-color: var(--line);
    background: var(--surface);
}

.teaching-offers-page {
    display: grid;
    gap: 0.7rem;
}

.teaching-offer-list-panel {
    display: grid;
    gap: 0.65rem;
    padding: 0.78rem;
}

.teaching-offer-card {
    overflow: hidden;
    padding: 0.78rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface-strong) 52%, transparent);
}

.teaching-offer-title {
    justify-content: flex-start;
    gap: 0.38rem;
}

.teaching-offer-title .status-chip {
    padding: 0.13rem 0.36rem;
    font-size: 0.62rem;
}

.teaching-offer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem;
}

.teaching-offer-actions > form {
    margin: 0;
}

.teaching-offer-inline-editor {
    margin: 0;
}

.teaching-offer-inline-editor > summary,
.teaching-offer-create-shell > summary {
    list-style: none;
    cursor: pointer;
}

.teaching-offer-inline-editor > summary::-webkit-details-marker,
.teaching-offer-create-shell > summary::-webkit-details-marker {
    display: none;
}

.teaching-offer-inline-editor[open] {
    flex: 1 1 100%;
    order: 20;
    width: 100%;
    padding-top: 0.2rem;
}

.teaching-offer-inline-editor[open] > summary {
    width: fit-content;
    margin-bottom: 0.5rem;
}

.teaching-offer-form {
    position: static;
    top: auto;
    width: 100%;
    gap: 0.6rem;
}

.teaching-offer-inline-editor .teaching-offer-form {
    padding: 0.65rem;
    border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.teaching-offer-create-shell {
    display: block;
    padding: 0;
}

.teaching-offer-create-shell > summary {
    display: flex;
    min-height: 3.4rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.7rem 0.82rem;
}

.teaching-offer-create-shell > summary > span {
    display: grid;
    gap: 0.08rem;
}

.teaching-offer-create-shell > summary > small {
    color: var(--gold);
    font-weight: 850;
}

.teaching-offer-create-shell[open] > summary {
    border-bottom: 1px solid var(--line);
}

.teaching-offer-create-shell > .teaching-offer-form {
    padding: 0.78rem;
}

.danger-outline-button {
    border-color: color-mix(in srgb, var(--rose) 42%, var(--line));
    color: color-mix(in srgb, var(--rose) 88%, white);
}

.finance-month-nav {
    grid-template-columns: minmax(8rem, auto) minmax(10rem, 1fr) minmax(8rem, auto);
}

.finance-month-arrow {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    gap: 0.32rem;
    padding: 0.28rem 0.15rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
    text-decoration: none;
}

.finance-month-arrow:last-child {
    justify-self: end;
}

.finance-month-arrow:hover {
    color: var(--gold);
}

.finance-current-month {
    justify-self: center;
    padding: 0.38rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--gold) 54%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold);
}

.finance-range-switch {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    gap: 0.16rem;
    padding: 0.18rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.finance-range-switch button {
    min-height: 1.9rem;
    padding: 0.28rem 0.58rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.finance-range-switch button.is-active {
    background: color-mix(in srgb, var(--gold) 15%, var(--surface));
    color: var(--gold);
}

.finance-chart-content {
    display: grid;
    gap: 0.65rem;
}

.finance-chart {
    grid-template-columns: repeat(var(--finance-visible-months, 1), minmax(2.5rem, 1fr));
    min-width: min(100%, calc(var(--finance-visible-months, 1) * 3rem));
}

.finance-page.is-single-month .finance-chart {
    grid-template-columns: minmax(4.5rem, 7.5rem);
    justify-content: center;
}

.finance-page.is-single-month .finance-chart-content {
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
    align-items: stretch;
}

.finance-page.is-single-month .finance-breakdown-summary {
    align-content: center;
}

.finance-chart-column {
    transition: height 480ms cubic-bezier(.22,.8,.28,1), opacity 160ms ease;
}

.finance-segment {
    cursor: pointer;
    transform-origin: bottom;
    transition: flex-basis 360ms ease, opacity 180ms ease, filter 150ms ease;
    box-shadow: inset 0 1px 0 rgba(7, 8, 10, .5);
}

.finance-segment:hover,
.finance-segment:focus-visible {
    filter: brightness(1.18);
}

.finance-page:not(.is-finance-chart-ready) .finance-chart-column {
    height: 0 !important;
}

.finance-breakdown-summary {
    display: grid;
    align-content: start;
    gap: 0;
    margin: 0;
}

.finance-breakdown-summary > span {
    display: grid;
    gap: 0.02rem;
    padding: 0.4rem 0;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    border-radius: 0;
    background: transparent;
}

.finance-breakdown-summary > span:last-child {
    border-bottom: 0;
}

.finance-chart-tooltip {
    position: fixed;
    z-index: 120;
    max-width: min(21rem, calc(100vw - 1.2rem));
    padding: 0.42rem 0.55rem;
    border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface-strong) 96%, black);
    box-shadow: 0 8px 28px rgb(0 0 0 / 32%);
    color: var(--text);
    font-size: 0.7rem;
    line-height: 1.35;
    pointer-events: none;
}

.policy-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    overflow: hidden;
}

.policy-list-card > .row-actions {
    flex-wrap: nowrap;
    align-items: center;
}

.policy-list-card > .row-actions form {
    margin: 0;
}

.tools-page .student-hero {
    grid-template-columns: minmax(0, 1fr);
}

.tools-page .student-hero > .tools-hero-inner {
    width: min(1120px, 100%);
    margin-inline: auto;
}

@media (max-width: 820px) {
    .material-resource-add-actions,
    .finance-page.is-single-month .finance-chart-content {
        grid-template-columns: 1fr;
    }

    .finance-month-nav {
        grid-template-columns: 1fr 1fr;
    }

    .finance-month-nav .finance-current-month {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

@media (max-width: 620px) {
    .material-bank-filter-form,
    .teacher-live-filter-form {
        grid-template-columns: 1fr;
    }

    .material-resource-add-actions {
        grid-template-columns: 1fr;
    }

    .teaching-offer-main {
        align-items: flex-start;
    }

    .teaching-offer-actions > form,
    .teaching-offer-actions > form > button,
    .teaching-offer-inline-editor:not([open]),
    .teaching-offer-inline-editor:not([open]) > summary {
        width: 100%;
    }

    .finance-range-switch {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .finance-range-switch button {
        min-width: 0;
        padding-inline: 0.25rem;
    }

    .finance-month-arrow span {
        display: none;
    }

    .policy-list-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* 2026-07 study history: calm item-by-item timeline */
.study-current-period {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem 1rem;
    align-items: start;
    padding: 1rem;
    border-radius: 13px;
}

.study-current-period-main h2 {
    margin: 0.15rem 0 0.25rem;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.study-current-period-main p,
.study-current-period-main small {
    margin: 0;
}

.study-current-period-side {
    display: grid;
    justify-items: end;
    gap: 0.4rem;
}

.study-routine-note {
    color: var(--muted);
    font-size: 0.75rem;
    text-align: right;
}

.period-update-note {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line));
    border-radius: 9px;
    background: color-mix(in srgb, var(--green) 7%, transparent);
}

.period-update-note.is-automatic {
    border-color: color-mix(in srgb, var(--gold) 32%, var(--line));
    background: color-mix(in srgb, var(--gold) 7%, transparent);
}

.period-update-note > span {
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 10%, transparent);
    color: var(--green);
    font-weight: 900;
}

.period-update-note.is-automatic > span {
    color: var(--gold);
}

.period-update-note p {
    margin: 0;
    color: var(--muted);
    font-size: 0.77rem;
    line-height: 1.42;
}

.period-update-note strong {
    display: block;
    color: var(--text);
}

.study-current-guidance {
    grid-column: 1 / -1;
    margin: 0;
}

.study-timeline-panel {
    position: relative;
    overflow: hidden;
    padding: 0.9rem;
}

.study-timeline-filters {
    margin: 0.65rem 0;
}

.study-timeline-filters label {
    min-width: 9.5rem;
}

.study-timeline-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border: 1px solid var(--line);
    border-radius: 10px;
    scrollbar-width: thin;
}

.study-timeline-table {
    min-width: calc(12rem + (var(--timeline-columns) * 5.2rem));
}

.study-timeline-header,
.study-timeline-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.5fr) repeat(var(--timeline-columns), minmax(5.2rem, 1fr));
}

.study-timeline-header {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 2.7rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 96%, black);
}

.study-timeline-header > strong,
.study-timeline-header > span {
    display: grid;
    place-content: center;
    padding: 0.35rem 0.45rem;
    border-right: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    color: var(--muted);
    font-size: 0.68rem;
    text-align: center;
}

.study-timeline-header > strong {
    position: sticky;
    left: 0;
    z-index: 4;
    justify-content: start;
    background: color-mix(in srgb, var(--surface-strong) 96%, black);
    color: var(--text);
    text-align: left;
}

.study-timeline-header > span.is-current {
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    color: var(--gold);
}

.study-timeline-header small {
    font-size: 0.58rem;
    text-transform: uppercase;
}

.study-timeline-area {
    position: sticky;
    left: 0;
    z-index: 2;
    padding: 0.36rem 0.55rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--gold) 8%, var(--surface));
    color: var(--gold);
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.study-timeline-row {
    min-height: 4.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.study-timeline-row:last-child {
    border-bottom: 0;
}

.study-timeline-row > strong {
    position: sticky;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 97%, black);
    font-size: 0.76rem;
    line-height: 1.25;
}

.study-timeline-cell {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 4.25rem;
    place-items: center;
    padding: 0.3rem;
    border: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
    background: transparent;
    color: var(--text);
}

button.study-timeline-cell {
    cursor: pointer;
}

button.study-timeline-cell:hover,
button.study-timeline-cell:focus-visible {
    outline: 0;
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}

.study-timeline-cell.is-empty::after {
    width: 0.32rem;
    height: 0.32rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--muted) 25%, transparent);
    content: "";
}

.study-timeline-cell-visual {
    position: relative;
    display: flex;
    width: 1.15rem;
    height: 2.65rem;
    align-items: end;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
    border-radius: 999px;
    background: var(--bg-soft);
}

.study-timeline-cell-visual i {
    width: 100%;
    min-height: 0.2rem;
    height: max(0.2rem, var(--timeline-progress));
    border-radius: inherit;
    background: var(--gold);
    transition: height 420ms cubic-bezier(.22,.8,.28,1);
}

.study-timeline-cell-visual.is-without-bar {
    width: 0.72rem;
    height: 0.72rem;
    align-items: center;
    border: 0;
    background: color-mix(in srgb, var(--gold) 24%, transparent);
}

.study-timeline-cell-visual.is-without-bar i {
    width: 0.36rem;
    height: 0.36rem;
    min-height: 0;
    margin: auto;
    border-radius: 50%;
}

.study-timeline-cell.is-completed .study-timeline-cell-visual {
    border-color: color-mix(in srgb, var(--green) 48%, var(--line));
}

.study-timeline-cell.is-completed .study-timeline-cell-visual i {
    height: 100%;
    background: var(--green);
}

.study-timeline-mark {
    position: absolute;
    top: 0.22rem;
    right: 0.3rem;
    color: var(--green);
    font-size: 0.65rem;
    font-weight: 950;
}

.study-timeline-mark.is-start {
    color: var(--gold);
    font-size: 0.5rem;
}

.study-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.68rem;
}

.study-timeline-legend span::before {
    display: inline-block;
    width: 0.48rem;
    height: 0.48rem;
    margin-right: 0.28rem;
    border-radius: 50%;
    background: var(--gold);
    content: "";
}

.study-timeline-legend .is-progress::before {
    border-radius: 999px;
}

.study-timeline-legend .is-complete::before {
    background: var(--green);
}

.study-progress-tooltip {
    position: fixed;
    z-index: 130;
    max-width: min(22rem, calc(100vw - 1.2rem));
    padding: 0.45rem 0.58rem;
    border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface-strong) 97%, black);
    box-shadow: 0 8px 28px rgb(0 0 0 / 32%);
    color: var(--text);
    font-size: 0.7rem;
    line-height: 1.38;
    pointer-events: none;
}

.study-progress-tooltip[hidden] {
    display: none !important;
}

.period-goal-group {
    display: grid;
    gap: 0;
}

.period-goal-group h4 {
    margin: 0.2rem 0 0;
    padding: 0.35rem 0.15rem;
    color: var(--gold);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.period-goal-group article,
.period-event-list article {
    min-height: 2.8rem;
    padding: 0.45rem 0.55rem;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
}

.period-goal-group article:last-child,
.period-event-list article:last-child {
    border-bottom: 0;
}

@media (max-width: 720px) {
    .study-current-period {
        grid-template-columns: 1fr;
        padding: 0.8rem;
    }

    .study-current-period-side,
    .study-routine-note {
        justify-items: start;
        text-align: left;
    }

    .study-current-period-side,
    .period-update-note,
    .study-current-guidance {
        grid-column: 1;
    }

    .study-timeline-panel {
        padding: 0.7rem;
    }

    .study-timeline-filters {
        grid-template-columns: 1fr 1fr;
        margin-bottom: 0.55rem;
    }

    .study-timeline-header,
    .study-timeline-row {
        grid-template-columns: minmax(9.5rem, 1.4fr) repeat(var(--timeline-columns), minmax(4.6rem, 1fr));
    }

    .study-timeline-table {
        min-width: calc(9.5rem + (var(--timeline-columns) * 4.6rem));
    }

    .study-timeline-row > strong {
        font-size: 0.71rem;
    }

    .period-summary-metrics {
        gap: 0.35rem;
    }
}

/* School workspace foundation */
.management-stack {
    display: grid;
    gap: 16px;
}

.compact-management-panel {
    padding: 18px;
    overflow: hidden;
}

.inline-management-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.inline-management-form input,
.inline-management-form select {
    width: min(100%, 360px);
    min-height: 40px;
}

.compact-student-row {
    min-height: 58px;
    gap: 14px;
}

.compact-student-row > div:first-child {
    min-width: 0;
}

@media (max-width: 680px) {
    .compact-management-panel {
        padding: 14px;
    }

    .compact-student-row,
    .compact-student-row .inline-management-form {
        align-items: stretch;
    }

    .compact-student-row .inline-management-form {
        width: 100%;
    }

    .inline-management-form input,
    .inline-management-form select {
        width: 100%;
    }
}

/* 2026-07 eagle-eye consistency package */
.relationship-chip {
    display: inline-flex;
    min-height: 1.35rem;
    align-items: center;
    padding: 0.08rem 0.38rem;
    border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 9%, transparent);
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.teacher-list-main .relationship-chip {
    margin-right: 0.12rem;
    color: var(--gold);
}

.search-form input[type="checkbox"],
.account-form input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 1.05rem;
    flex: 0 0 1.05rem;
    padding: 0;
    accent-color: var(--gold);
}

.student-live-search {
    display: grid;
    min-width: min(42rem, 100%);
    grid-template-columns: minmax(16rem, 1fr) auto;
    gap: 0.55rem 0.8rem;
    align-items: end;
}

.student-search-main {
    display: grid;
    min-width: 0;
    gap: 0.32rem;
}

.student-search-main > label {
    color: var(--muted);
    font-weight: 700;
}

.student-live-search > .student-limited-filter,
.student-live-search > label:first-child {
    grid-column: auto;
}

.student-limited-filter {
    display: inline-flex;
    min-height: 3rem;
    align-self: end;
    align-items: center;
    gap: 0.42rem;
    padding: 0.45rem 0.62rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    color: var(--muted);
    cursor: pointer;
}

.student-detail-actions > a,
.student-detail-actions > form {
    width: 10.4rem;
}

.student-detail-actions > form > .button,
.student-detail-actions > a.button {
    width: 100%;
    height: 3rem;
    min-height: 3rem;
}

.student-archive-symbol {
    display: inline-grid;
    width: 0.95rem;
    height: 0.95rem;
    place-items: center;
    flex: 0 0 0.95rem;
    font-size: 0.92rem;
    line-height: 1;
}

.profile-summary > div {
    min-width: 0;
}

.profile-summary h2,
.profile-summary .guardian-account-line {
    overflow-wrap: anywhere;
}

.compact-streak-form select {
    width: 8.4rem;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--bg);
    color: var(--text);
    font: inherit;
}

.eye-line-icon {
    width: 1.12rem;
    height: 0.82rem;
    border: 0;
    border-radius: 0;
    background: currentColor;
    transform: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M12 1C6.5 1 2.3 4.1.4 7.5a1 1 0 0 0 0 1C2.3 11.9 6.5 15 12 15s9.7-3.1 11.6-6.5a1 1 0 0 0 0-1C21.7 4.1 17.5 1 12 1Zm0 2c4.1 0 7.5 2.1 9.4 5-1.9 2.9-5.3 5-9.4 5S4.5 10.9 2.6 8C4.5 5.1 7.9 3 12 3Zm0 1.8A3.2 3.2 0 1 0 12 11.2 3.2 3.2 0 0 0 12 4.8Zm0 2A1.2 1.2 0 1 1 12 9.2 1.2 1.2 0 0 1 12 6.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M12 1C6.5 1 2.3 4.1.4 7.5a1 1 0 0 0 0 1C2.3 11.9 6.5 15 12 15s9.7-3.1 11.6-6.5a1 1 0 0 0 0-1C21.7 4.1 17.5 1 12 1Zm0 2c4.1 0 7.5 2.1 9.4 5-1.9 2.9-5.3 5-9.4 5S4.5 10.9 2.6 8C4.5 5.1 7.9 3 12 3Zm0 1.8A3.2 3.2 0 1 0 12 11.2 3.2 3.2 0 0 0 12 4.8Zm0 2A1.2 1.2 0 1 1 12 9.2 1.2 1.2 0 0 1 12 6.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.eye-line-icon::before { display: none; }

.google-meet-icon,
.google-calendar-icon {
    display: inline-block;
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 1.05rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.icon-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.google-meet-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23008a55' d='M2 6.4A2.4 2.4 0 0 1 4.4 4h8.7l3.5 3.5v9L13.1 20H4.4A2.4 2.4 0 0 1 2 17.6Z'/%3E%3Cpath fill='%2300ac47' d='M16.6 7.5 22 4.4v15.2l-5.4-3.1Z'/%3E%3Cpath fill='%23ffba00' d='m13.1 4 3.5 3.5-3.5 3.5Z'/%3E%3Cpath fill='%232685fc' d='m13.1 20 3.5-3.5-3.5-3.5Z'/%3E%3C/svg%3E");
}

.google-calendar-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M5 2h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3Z'/%3E%3Cpath fill='%234285f4' d='M2 8h20v11a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3Z'/%3E%3Cpath fill='%23ea4335' d='M5 2h14a3 3 0 0 1 3 3v3H2V5a3 3 0 0 1 3-3Z'/%3E%3Cpath fill='%23fbbc04' d='M2 8h5v14H5a3 3 0 0 1-3-3Z'/%3E%3Cpath fill='%2334a853' d='M17 8h5v11a3 3 0 0 1-3 3h-2Z'/%3E%3Ctext x='12' y='18' text-anchor='middle' font-family='Arial' font-size='9' font-weight='700' fill='white'%3E31%3C/text%3E%3C/svg%3E");
}

.note-line-icon::before {
    transform: translateY(-0.13rem);
}

.account-form .simple-progress-control input[type="range"],
.account-form .locked-progress-preview input[type="range"] {
    min-height: 0;
    padding: 0;
}

.progress-edit-row input[type="range"] {
    height: 0.32rem;
}

.progress-edit-row input[type="range"]::-webkit-slider-thumb {
    width: 1rem;
    height: 1rem;
}

.progress-mode-choices label {
    min-height: 2.15rem;
    padding: 0.36rem 0.5rem;
}

.automatic-progress-summary .duo-progress {
    height: 0.36rem;
    box-shadow: none;
}

.material-area-filter input {
    position: relative;
    display: inline-grid;
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 0.95rem;
    place-items: center;
    opacity: 1;
    pointer-events: auto;
    appearance: none;
    border: 1px solid color-mix(in srgb, var(--muted) 68%, var(--line));
    border-radius: 4px;
    background: var(--bg);
}

.material-area-filter input:checked {
    border-color: var(--gold);
    background: var(--gold);
}

.material-area-filter input:checked::after {
    content: "✓";
    color: var(--on-gold);
    font-size: 0.7rem;
    font-weight: 950;
    line-height: 1;
}

.material-area-filter span {
    border: 0;
    padding: 0;
    background: transparent;
}

.search-form .material-area-filter {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    gap: 0.38rem;
    padding: 0.28rem 0.52rem;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.search-form .material-area-filter:has(input:checked) {
    border-color: color-mix(in srgb, var(--gold) 56%, var(--line));
    background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.material-sort-card-head {
    grid-template-columns: 1.65rem 1.3rem minmax(0, 1fr) 3rem 1.8rem 1.8rem;
    gap: 0.25rem;
    padding: 0.58rem 0.68rem;
}

.material-sort-card-head > .drag-grip { grid-column: 1; grid-row: 1; }
.material-sort-card-head > .resource-kind-icon { grid-column: 2; grid-row: 1; }
.material-sort-card-head > .material-sort-title { grid-column: 3; grid-row: 1; }
.material-sort-card-head > .sort-accessible-actions { grid-column: 4; grid-row: 1; }
.material-sort-card-head > .material-resource-edit-toggle {
    grid-column: 5;
    grid-row: 1;
    width: 1.8rem;
    height: 1.8rem;
    min-height: 0;
}

.study-history-infographic {
    margin: 0.75rem 0;
    overflow: hidden;
    padding: 0;
}

.study-history-infographic > summary {
    display: flex;
    min-height: 3.8rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.study-history-infographic > summary::-webkit-details-marker {
    display: none;
}

.study-history-infographic > summary > span:first-child {
    display: grid;
    min-width: 0;
    gap: 0.08rem;
}

.study-history-infographic > summary small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.study-history-infographic > summary > span:last-child {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 850;
}

.study-history-infographic[open] > summary {
    border-bottom: 1px solid var(--line);
}

.study-history-infographic[open] > summary > span:last-child::before {
    content: "Fechar ";
}

.study-history-infographic[open] > summary > span:last-child {
    font-size: 0;
}

.study-history-infographic[open] > summary > span:last-child::before {
    font-size: 0.75rem;
}

.study-history-infographic-body {
    padding: 0.8rem;
}

.study-history-infographic-body > .muted-note {
    margin: 0 0 0.55rem;
}

.material-sort-card-head > .material-resource-edit-form {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0.42rem 0 0;
    padding: 0.72rem 0 0;
    border-top: 1px solid var(--line);
}

.material-sort-card-head > .material-resource-edit-form[hidden] {
    display: none;
}

.material-sort-card-head > .material-resource-delete {
    grid-column: 6;
    grid-row: 1;
    width: 1.8rem;
    margin: 0;
}

.material-sort-card-head > .material-resource-delete .icon-button {
    width: 1.8rem;
    height: 1.8rem;
    min-height: 0;
}

.material-resource-add-actions > details,
.material-resource-add-actions > details > form {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.material-resource-add-actions > .inline-details {
    margin: 0;
    overflow: hidden;
}

.material-resource-add-actions > details[open] > summary {
    margin: 0;
}

.material-resource-add-actions > details > form {
    width: 100%;
    overflow: hidden;
}

.material-resource-add-actions > details > form input,
.material-resource-add-actions > details > form .field-stack {
    max-width: 100%;
    box-sizing: border-box;
}

.material-bulk-delete-toolbar {
    display: flex;
    min-height: 2.4rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.42rem;
    padding: 0.32rem 0.42rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.material-bulk-delete-toolbar > span {
    margin-right: auto;
    color: var(--muted);
    font-size: 0.72rem;
}

.material-bulk-delete-toolbar .trash-line-icon {
    width: 0.8rem;
    height: 0.8rem;
}

.material-item-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.material-item-row,
.material-item-row:last-child {
    grid-template-columns: 1.35rem 1rem minmax(0, 1fr) 3rem 3.18rem 1.65rem;
    min-width: 0;
    min-height: 2.35rem;
    padding: 0.14rem 0.28rem;
    border: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
}

.material-item-select {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
    accent-color: var(--gold);
}

.student-unit-editor-list {
    overflow: visible;
    border: 0;
    border-radius: 0;
}

.student-unit-section {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
}

.student-unit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-unit-editor-row {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    min-height: 2.35rem;
    gap: 0.38rem;
    align-items: center;
    padding: 0.3rem 0.42rem;
    border: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
    border-radius: 0;
    cursor: pointer;
}

.student-unit-editor-row input {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
    accent-color: var(--gold);
}

.student-unit-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.student-unit-editor-row .status-chip {
    min-width: 0;
    padding-inline: 0.3rem;
    font-size: 0.58rem;
}

.automatic-picker-head > div {
    display: grid;
    gap: 0.08rem;
}

.automatic-picker-head small { color: var(--muted); font-size: 0.7rem; }

.unit-action-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.38rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--gold) 5%, transparent);
}

.unit-action-toolbar > span { color: var(--muted); font-size: 0.72rem; }
.unit-action-toolbar > div { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.material-unit-check-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-toolbar {
    display: grid;
    grid-template-columns: auto minmax(16rem, 28rem);
    justify-content: start;
    gap: 0.65rem 1rem;
    align-items: center;
}

.billing-toolbar .live-search-form {
    display: grid;
    grid-template-columns: auto minmax(12rem, 1fr);
    flex: none;
    gap: 0.5rem;
    align-items: center;
}

.billing-toolbar .live-search-form label {
    flex: none;
    color: var(--muted);
}

.billing-toolbar .live-search-form input {
    height: 2.4rem;
    min-height: 2.4rem;
    padding-block: 0.42rem;
}

.billing-group {
    display: block;
}

.billing-group-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 0.7rem;
    list-style: none;
    cursor: pointer;
}

.billing-group-heading::-webkit-details-marker { display: none; }
.billing-group-heading::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.12rem) rotate(45deg);
    transition: transform 150ms ease;
}

.billing-group[open] > .billing-group-heading::after {
    transform: translateY(0.1rem) rotate(225deg);
}

.billing-group-heading > .billing-group-count {
    display: grid;
    min-width: 1.6rem;
    height: 1.6rem;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 14%, transparent);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
}

.billing-fee-list > li,
.billing-fee-list > li.status-paid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16rem;
    gap: 0.7rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-radius: 0;
}

.billing-fee-list .row-actions {
    display: flex;
    width: 16rem;
    justify-content: flex-end;
    gap: 0.35rem;
}

.billing-fee-list .row-actions > form { margin: 0; }
.billing-fee-list .row-actions .button { min-width: 6.6rem; }

@media (max-width: 1080px) {
    .material-item-list,
    .student-unit-grid,
    .material-unit-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .student-live-search,
    .billing-toolbar {
        grid-template-columns: 1fr;
    }

    .billing-toolbar .live-search-form {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .student-live-search { min-width: 0; }
    .student-limited-filter { min-height: 2.55rem; align-self: stretch; }
    .student-detail-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }
    .student-detail-actions > a,
    .student-detail-actions > form { width: 100%; min-width: 0; }
    .student-detail-actions .button { min-width: 0; padding-inline: 0.6rem; }

    .material-sort-card-head {
        grid-template-columns: 1.45rem 1.15rem minmax(0, 1fr) 2.7rem 1.65rem 1.65rem;
        gap: 0.14rem;
        padding-inline: 0.38rem;
    }

    .material-item-list,
    .student-unit-grid,
    .material-unit-check-grid {
        grid-template-columns: 1fr;
    }

    .material-item-row,
    .material-item-row:last-child {
        grid-template-columns: 1.35rem 1rem minmax(0, 1fr) 2.78rem 2.88rem 1.45rem;
        border-right: 0;
    }

    .unit-action-toolbar,
    .automatic-picker-head {
        align-items: stretch;
        flex-direction: column;
    }

    .unit-action-toolbar > div {
        display: grid;
        grid-template-columns: 1fr;
    }

    .billing-fee-list > li,
    .billing-fee-list > li.status-paid-row {
        grid-template-columns: 1fr;
    }

    .billing-fee-list .billing-fee-main,
    .billing-fee-list.action-list > li > .row-actions {
        grid-column: 1;
        grid-row: auto;
    }

    .billing-fee-list .row-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Final study-unit layout authority. */
.study-unit-summary {
    display: block;
    gap: 0;
    width: 100%;
    max-width: none;
    overflow: hidden;
    padding: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
}

.study-unit-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.study-unit-summary-row,
.study-unit-summary-row + .study-unit-summary-row {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    gap: 0.34rem;
    align-items: center;
    min-width: 0;
    min-height: 2.35rem;
    padding: 0.25rem 0.38rem;
    border: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
}

.study-unit-summary-name {
    display: block;
    min-width: 0;
    overflow: hidden;
}

.study-unit-summary-name strong {
    font-size: 0.74rem;
    line-height: 1.1;
}

.study-unit-summary-name small {
    margin-top: 0.04rem;
    font-size: 0.58rem;
}

.study-unit-summary-row .study-unit-state {
    width: 0.9rem;
    height: 0.9rem;
    flex-basis: 0.9rem;
    font-size: 0.62rem;
}

.study-unit-summary-row .status-chip {
    min-width: 0;
    padding: 0.1rem 0.28rem;
    font-size: 0.55rem;
}

@media (max-width: 1080px) {
    .study-unit-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
    .study-unit-summary-grid { grid-template-columns: 1fr; }
}

/* 2026-07 content, billing and meter final alignment */
.study-item-card > summary {
    display: grid;
    grid-template-columns: 0.52rem 1.18rem minmax(0, 1fr) auto;
    gap: 0.24rem 0.46rem;
    align-items: center;
}

.study-item-card > summary::after {
    grid-column: 1;
    grid-row: 1;
    order: initial;
    margin: 0;
}

.study-item-card > summary::before {
    grid-column: 2;
    grid-row: 1;
}

.study-item-card > summary > span:first-of-type {
    grid-column: 3;
    grid-row: 1;
}

.study-item-card > summary .status-chip {
    grid-column: 4;
    grid-row: 1;
    order: initial;
}

.study-item-card > summary .summary-progress {
    display: grid;
    grid-column: 3 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 0.02rem;
    text-align: right;
}

.study-item-card > summary .summary-progress > span {
    grid-column: 2;
    grid-row: 1;
}

.study-item-card > summary .summary-progress > .duo-progress {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}

.study-content-empty,
.study-content-edit-hint {
    margin: 0;
    padding: 0.48rem 0.56rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.study-content-edit-hint {
    padding-top: 0;
}

.study-content-edit-hint a {
    color: var(--gold);
    font-weight: 850;
}

.weekly-content-editor {
    margin-bottom: 0.7rem;
    scroll-margin-top: 5rem;
}

.weekly-content-editor > summary {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
}

.weekly-content-editor > summary small {
    color: var(--muted);
}

.action-list > li.status-paid-row,
.action-list > li.status-late-row,
.action-list > li.status-reported {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.meter-preset-choice {
    display: grid;
    gap: 0.24rem;
    min-width: 0;
}

.meter-preset-choice > small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 750;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meter-preset-choice > button {
    width: 100%;
}

.rhythm-note-card .meter-rhythm-number {
    font-family: "Bravura", serif;
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1;
}

.metronome-view-tabs {
    margin-top: 0.12rem;
}

@media (max-width: 760px) {
    .study-item-card > summary {
        grid-template-columns: 0.52rem 1rem minmax(0, 1fr);
    }

    .study-item-card > summary::after { grid-column: 1; }
    .study-item-card > summary::before { grid-column: 2; }
    .study-item-card > summary > span:first-of-type { grid-column: 3; }
    .study-item-card > summary .status-chip { display: none; }
    .study-item-card > summary .summary-progress { grid-column: 3 / -1; }
}

.pwa-status,
.pwa-install-panel,
.pwa-update-panel,
.pwa-release-panel,
.push-permission-panel {
    position: fixed;
    z-index: 1100;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.study-item-card > summary .study-current-content {
    display: block;
    overflow: hidden;
    margin-top: 0.12rem;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwa-status {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    padding: 0.45rem 0.72rem;
    border: 1px solid rgba(251, 181, 27, 0.34);
    border-radius: 999px;
    background: rgba(18, 20, 26, 0.94);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
}

.pwa-install-panel,
.pwa-update-panel,
.push-permission-panel {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: min(25rem, calc(100vw - 2rem));
    padding: 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: rgba(18, 20, 26, 0.97);
    color: var(--text);
}

.pwa-install-panel strong,
.push-permission-panel strong {
    display: block;
    font-size: 0.95rem;
}

.pwa-install-panel p,
.pwa-update-panel span,
.push-permission-panel p {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.pwa-install-panel .pwa-ios-install {
    color: var(--gold);
}

.pwa-panel-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
}

.pwa-install-panel .button,
.pwa-update-panel .button,
.push-permission-panel .button {
    min-height: 2.35rem;
    padding: 0.55rem 0.78rem;
    font-size: 0.8rem;
}

.pwa-panel-close {
    width: 2.35rem;
    padding-inline: 0;
}

.pwa-release-panel {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    display: grid;
    gap: 0.85rem;
    width: min(32rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid rgba(251, 181, 27, 0.46);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(90deg, rgba(251, 181, 27, 0.72), rgba(31, 207, 163, 0.42)) top / 100% 1px no-repeat,
        rgba(18, 20, 26, 0.98);
    color: var(--text);
}

.pwa-update-panel {
    padding-right: 2.8rem;
}

.pwa-update-close {
    position: absolute;
    top: 0.42rem;
    right: 0.42rem;
    display: grid;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.pwa-update-close:hover,
.pwa-update-close:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.pwa-release-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.pwa-release-copy > strong {
    display: block;
    font-size: 1rem;
    line-height: 1.25;
}

.pwa-release-copy > p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.pwa-release-guide {
    margin-top: 0.8rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.pwa-release-guide ol {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.4;
}

.pwa-release-guide small {
    display: block;
    margin-top: 0.65rem;
    color: var(--gold);
    font-size: 0.75rem;
    line-height: 1.35;
}

.pwa-release-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pwa-release-actions .button {
    min-height: 2.35rem;
    padding: 0.55rem 0.78rem;
    font-size: 0.8rem;
}

.offline-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(251, 181, 27, 0.11), transparent 28rem),
        var(--bg);
}

.offline-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.offline-card {
    width: min(31rem, 100%);
    padding: clamp(1.25rem, 5vw, 2rem);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.offline-logo {
    width: min(14rem, 72vw);
    height: auto;
    margin-bottom: 1.35rem;
}

.offline-card h1 {
    margin: 0.25rem 0 0.75rem;
    font-size: clamp(1.65rem, 8vw, 2.35rem);
}

.offline-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.offline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.2rem;
}

@media (max-width: 760px) {
    .pwa-install-panel,
    .pwa-update-panel,
    .pwa-release-panel,
    .push-permission-panel {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    .pwa-install-panel,
    .pwa-update-panel,
    .push-permission-panel {
        align-items: stretch;
        flex-direction: column;
    }

    body.is-authenticated .pwa-release-panel {
        bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4.25rem));
        max-height: calc(100vh - 6rem);
    }

    .pwa-panel-actions {
        width: 100%;
    }

    .pwa-panel-actions .button:first-child,
    .pwa-update-panel .button {
        flex: 1;
    }

    .pwa-release-actions .button {
        flex: 1 1 9rem;
    }
}

@media (max-width: 760px) {
    .pwa-update-panel {
        display: grid;
        grid-template-columns: 3rem minmax(0, 1fr);
        align-items: center;
        gap: 0.45rem 0.65rem;
    }

    .pwa-update-panel .dodo-mascot {
        grid-row: 1;
        width: 3rem;
        margin: -0.35rem;
    }

    .pwa-update-panel > span {
        grid-column: 2;
        margin: 0;
    }

    .pwa-update-panel .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .dodo-goal-celebration {
        grid-template-columns: 4.6rem minmax(0, 1fr);
        margin-top: 0.2rem;
    }

    .dodo-goal-celebration .dodo-mascot {
        width: 4.6rem;
    }

    .dodo-goal-celebration > span {
        font-size: 0.85rem;
        line-height: 1.3;
    }
}

.material-resource-open {
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.material-resource-open:hover strong,
.material-resource-open:focus-visible strong {
    color: var(--gold);
}

.material-resource-open:focus-visible {
    outline: 1px solid color-mix(in srgb, var(--gold) 58%, transparent);
    outline-offset: 3px;
    border-radius: 4px;
}

.finance-expected-timeline {
    grid-column: 2;
    display: grid;
    gap: .3rem;
    min-width: 26rem;
    margin-top: .45rem;
}

.finance-expected-label {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
}

.finance-expected-timeline > div {
    position: relative;
    height: 3.45rem;
    border-top: 1px solid var(--line);
}

.finance-day-start,
.finance-day-end {
    position: absolute;
    top: .22rem;
    color: var(--muted);
    font-size: .58rem;
    font-style: normal;
}

.finance-day-start { left: 0; }
.finance-day-end { right: 0; }

.finance-expected-marker {
    position: absolute;
    top: -.18rem;
    display: grid;
    gap: 0;
    min-width: 2.8rem;
    padding: .26rem .35rem;
    border: 1px dashed color-mix(in srgb, var(--gold) 48%, var(--line));
    border-radius: 7px;
    background: color-mix(in srgb, var(--gold) 6%, var(--surface));
    color: var(--muted);
    text-align: center;
    transform: translateX(-50%);
}

.finance-expected-marker b { color: var(--gold); font-size: .68rem; }
.finance-expected-marker small { font-size: .58rem; white-space: nowrap; }
.finance-expected-marker.is-received {
    border-style: solid;
    border-color: color-mix(in srgb, var(--green) 50%, var(--line));
    background: color-mix(in srgb, var(--green) 8%, var(--surface));
}
.finance-expected-marker.is-received b { color: var(--green); }

.finance-detail-row {
    grid-template-columns: 2.3rem minmax(0, 1fr) minmax(13rem, auto);
}

.finance-student-avatar {
    width: 2.15rem;
    height: 2.15rem;
    display: grid !important;
    place-items: center;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 9%, var(--surface));
    color: var(--gold);
    font-weight: 900;
}

.finance-student-avatar img { width: 100%; height: 100%; object-fit: cover; }
.finance-detail-row.is-received_on_time,
.finance-detail-row.is-received_estimated { border-color: color-mix(in srgb, var(--green) 36%, var(--line)); }
.finance-detail-row.is-received_late { border-color: color-mix(in srgb, var(--gold) 42%, var(--line)); }
.finance-detail-row.is-not_received { border-color: color-mix(in srgb, var(--rose) 52%, var(--line)); }
.finance-detail-row.is-open { border-color: color-mix(in srgb, var(--gold) 28%, var(--line)); }

@media (max-width: 820px) {
    .finance-detail-row { grid-template-columns: 2.3rem minmax(0, 1fr); }
    .finance-detail-row > span:last-child { grid-column: 2; }
}

/* Financeiro diário, cobranças dispensadas e banco de materiais compacto. */
.finance-summary-card.is-overdue.is-clear > strong {
    color: var(--text);
    font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.finance-summary-card.is-overdue.has-overdue > strong { color: var(--rose); }
.finance-summary-card small b { color: var(--gold); }
.finance-chart-content,
.finance-page.is-single-month .finance-chart-content { grid-template-columns: minmax(0, 1fr); }
.finance-chart-view[hidden] { display: none !important; }
.finance-chart-view { min-width: 0; }
.finance-chart-daily {
    grid-template-columns: repeat(var(--finance-visible-days, 1), minmax(4.25rem, 1fr));
    min-width: max(100%, calc(var(--finance-visible-days, 1) * 4.7rem));
}
.finance-page.is-single-month .finance-chart-daily {
    grid-template-columns: repeat(var(--finance-visible-days, 1), minmax(4.25rem, 1fr));
    justify-content: stretch;
}
.finance-chart-day .finance-chart-column { width: min(2rem, 72%); }
.finance-day-label {
    display: grid;
    align-self: center;
    color: var(--muted);
    font-size: .62rem;
    line-height: 1.15;
    text-align: center;
}
.finance-day-label strong { color: var(--gold); font-size: .68rem; }
.finance-chart-empty {
    align-self: center;
    min-width: 16rem;
    color: var(--muted);
    text-align: center;
}
.finance-expected-dates {
    display: grid;
    gap: .38rem;
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-strong) 58%, transparent);
}
.finance-expected-dates > strong { color: var(--muted); font-size: .72rem; }
.finance-expected-dates > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .35rem; }
.finance-expected-date {
    display: grid;
    gap: .04rem;
    padding: .42rem .5rem;
    border: 1px solid color-mix(in srgb, var(--gold) 32%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--gold) 5%, var(--surface));
}
.finance-expected-date b { color: var(--gold); font-size: .76rem; }
.finance-expected-date small { color: var(--muted); font-size: .64rem; }
.finance-expected-date.is-received { border-color: color-mix(in srgb, var(--green) 42%, var(--line)); }
.finance-expected-date.is-received b { color: var(--green); }

.status-waived-row {
    border-color: color-mix(in srgb, var(--muted) 35%, var(--line)) !important;
    background: color-mix(in srgb, var(--muted) 5%, transparent);
}
.fee-waiver-action { position: relative; }
.fee-waiver-action > summary {
    min-height: 2rem;
    padding: .38rem .55rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    cursor: pointer;
    font-size: .72rem;
    font-weight: 800;
    list-style: none;
}
.fee-waiver-action > summary::-webkit-details-marker { display: none; }
.fee-waiver-action > form {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% + .35rem);
    display: grid;
    gap: .4rem;
    width: min(20rem, 82vw);
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}
.fee-waiver-action label { display: grid; gap: .25rem; color: var(--muted); font-size: .72rem; }

.material-bank-list { display: grid; gap: .45rem; }
.material-bank-card {
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
}
.material-bank-card > summary {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr) auto;
    gap: .45rem;
    align-items: center;
    min-height: 3.6rem;
    padding: .52rem .65rem;
    cursor: pointer;
    list-style: none;
}
.material-bank-card > summary::-webkit-details-marker { display: none; }
.material-bank-chevron { color: var(--gold); font-size: 1.45rem; line-height: 1; transition: transform 180ms ease; }
.material-bank-card[open] .material-bank-chevron { transform: rotate(90deg); }
.material-bank-card-title { display: grid; gap: .08rem; min-width: 0; }
.material-bank-card-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-bank-card-title small { color: var(--muted); font-size: .7rem; }
.material-bank-card-body {
    display: grid;
    gap: .5rem;
    padding: .6rem .75rem .7rem 2.5rem;
    border-top: 1px solid var(--line);
}
.material-bank-card-body > p { margin: 0; color: var(--muted); font-size: .82rem; }
.material-bank-meta { display: flex; flex-wrap: wrap; gap: .28rem .7rem; color: var(--muted); font-size: .68rem; }
.material-bank-meta-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.material-bank-row-actions { display: flex; justify-content: flex-end; align-items: center; }
.material-bank-edit { display: inline-flex; gap: .35rem; align-items: center; }
.material-bank-edit .study-edit-box-icon { width: 1rem; height: 1rem; }
.material-bank-readonly { color: var(--muted); font-size: .7rem; }

@media (max-width: 560px) {
    .finance-chart-wrap { grid-template-columns: 3.35rem minmax(0, 1fr); }
    .material-bank-card > summary { grid-template-columns: 1.25rem minmax(0, 1fr); }
    .material-bank-card > summary > .status-chip { grid-column: 2; justify-self: start; }
    .material-bank-card-body { padding-left: .65rem; }
    .material-bank-meta-row { align-items: flex-start; flex-direction: column; }
    .material-bank-row-actions { width: 100%; justify-content: flex-start; }
    .fee-waiver-action > form { position: fixed; right: 1rem; bottom: 1rem; top: auto; }
}

/* Login e ações principais: toque imediato, sem seleção acidental no celular. */
button,
.button,
.profile-choice-card,
.mobile-tabbar-item,
.authenticated-main-nav a,
.authenticated-submenu > summary {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button,
.button,
.profile-choice-card {
    -webkit-user-select: none;
    user-select: none;
}

form.is-submitting {
    pointer-events: none;
}

[data-submit-loading][aria-busy="true"] {
    opacity: 0.82;
}

/* Solicitação de acesso */
.signup-request-page {
    background: var(--bg);
}

.signup-request-shell {
    min-height: calc(100svh - 4.2rem);
    padding: clamp(0.7rem, 1.5vw, 1.25rem);
    background:
        linear-gradient(105deg, rgba(7, 8, 10, 0.97) 0%, rgba(7, 8, 10, 0.88) 52%, rgba(7, 8, 10, 0.78) 100%),
        var(--hero-image) center / cover fixed;
}

.signup-request-wrap {
    width: min(74rem, 100%);
    margin-inline: auto;
}

.signup-request-heading {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 0.65rem;
}

.signup-request-logo {
    width: clamp(6.2rem, 9vw, 8rem);
    height: auto;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.signup-request-heading h1,
.signup-request-heading p {
    margin-block: 0;
}

.signup-request-heading h1 {
    font-size: clamp(1.65rem, 2.8vw, 2.35rem);
    line-height: 1;
    text-transform: none;
}

.signup-request-heading p:last-child {
    max-width: 44rem;
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.signup-request-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem);
    gap: 0.75rem;
    align-items: start;
}

.signup-request-main {
    display: grid;
    gap: 0.6rem;
    min-width: 0;
}

.signup-request-step,
.signup-request-summary {
    position: relative;
    overflow: hidden;
    margin: 0;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.signup-request-step {
    padding: 0.72rem 0.85rem;
}

.signup-request-step::before,
.signup-request-summary::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--teal), transparent 86%);
}

.signup-account-step::before {
    background: linear-gradient(90deg, var(--teal), #68a7ff, transparent 86%);
}

.signup-details-step::before {
    background: linear-gradient(90deg, #e77824, var(--gold), transparent 86%);
}

.signup-step-heading {
    display: grid;
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
    margin-bottom: 0.52rem;
}

.signup-step-heading h2,
.signup-step-heading p {
    margin: 0;
}

.signup-step-heading h2 {
    font-size: 0.98rem;
    text-transform: none;
}

.signup-step-heading p {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.signup-step-number {
    display: inline-grid;
    width: 1.5rem;
    height: 1.5rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 58%, var(--line));
    border-radius: 50%;
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 9%, transparent);
    font-size: 0.68rem;
    font-weight: 900;
}

.signup-request-page .access-type-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.42rem;
}

.signup-request-page .access-type-option {
    position: relative;
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr);
    gap: 0.46rem;
    min-height: 5.3rem;
    align-content: start;
    padding: 0.55rem;
    overflow: hidden;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg) 48%, var(--surface));
    box-shadow: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.signup-request-page .access-type-option::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: var(--request-card-color, var(--gold));
    opacity: 0.72;
}

.signup-request-page .access-type-student { --request-card-color: #66d6c6; }
.signup-request-page .access-type-teacher { --request-card-color: var(--gold); }
.signup-request-page .access-type-school { --request-card-color: #68a7ff; }
.signup-request-page .access-type-other { --request-card-color: #e77824; }

.signup-request-page .access-type-option:hover {
    z-index: 1;
    border-color: color-mix(in srgb, var(--request-card-color) 72%, var(--line));
    background: color-mix(in srgb, var(--request-card-color) 7%, var(--surface));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
    transform: translateY(-3px);
}

.signup-request-page .access-type-option:has(input:checked) {
    border-color: var(--request-card-color);
    background: color-mix(in srgb, var(--request-card-color) 11%, var(--surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--request-card-color) 34%, transparent);
}

.signup-request-page .access-type-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.signup-request-page .access-type-option:has(input:focus-visible) {
    outline: 2px solid var(--request-card-color);
    outline-offset: 2px;
}

.access-request-card-icon {
    display: inline-grid;
    width: 2.05rem;
    height: 2.05rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--request-card-color, var(--teal)) 58%, var(--line));
    border-radius: 9px;
    color: var(--request-card-color, var(--teal));
    background: color-mix(in srgb, var(--request-card-color, var(--teal)) 10%, transparent);
}

.access-request-card-icon.is-teal { --request-card-color: var(--teal); }
.access-request-card-icon.is-gold { --request-card-color: var(--gold); }

.access-type-copy {
    min-width: 0;
}

.signup-request-page .access-type-option strong {
    font-size: 0.74rem;
    line-height: 1.2;
}

.signup-request-page .access-type-option small {
    margin-top: 0.2rem;
    font-size: 0.63rem;
}

.access-type-check {
    position: absolute;
    top: 0.45rem;
    right: 0.48rem;
    display: inline-grid;
    width: 1.05rem;
    height: 1.05rem;
    place-items: center;
    border-radius: 50%;
    color: var(--bg);
    background: var(--request-card-color);
    font-size: 0.68rem;
    font-weight: 950;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 160ms ease, transform 160ms ease;
}

.access-type-option:has(input:checked) .access-type-check {
    opacity: 1;
    transform: scale(1);
}

.signup-account-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.48rem;
}

.signup-account-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    min-height: 3.7rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: color-mix(in srgb, var(--bg) 45%, var(--surface));
    text-align: left;
    cursor: pointer;
    transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.signup-account-option:hover,
.signup-account-option.is-selected {
    border-color: color-mix(in srgb, var(--teal) 70%, var(--line));
    background: color-mix(in srgb, var(--teal) 9%, var(--surface));
    transform: translateY(-2px);
}

.signup-account-option strong,
.signup-account-option small {
    display: block;
}

.signup-account-option small {
    margin-top: 0.08rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.signup-existing-account,
.signup-new-account-fields {
    margin-top: 0.7rem;
}

.signup-existing-account {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    border: 1px solid color-mix(in srgb, var(--teal) 40%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--teal) 7%, var(--surface));
}

.signup-existing-account p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.signup-new-account-fields,
.signup-student-fields {
    display: grid;
    gap: 0.65rem;
}

.signup-request-page .field-grid {
    gap: 0.65rem;
}

.signup-request-page .field-stack {
    gap: 0.25rem;
}

.signup-request-page label,
.signup-request-page .field-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.signup-request-page input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.signup-request-page select,
.signup-request-page textarea {
    width: 100%;
    min-width: 0;
    min-height: 2.55rem;
    padding: 0.58rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: color-mix(in srgb, var(--bg) 76%, var(--surface));
    font: inherit;
    color-scheme: dark;
}

.signup-request-page textarea {
    min-height: 5.2rem;
    resize: vertical;
}

.signup-request-page input:focus,
.signup-request-page select:focus,
.signup-request-page textarea:focus {
    border-color: var(--teal);
    outline: 2px solid color-mix(in srgb, var(--teal) 24%, transparent);
}

.signup-request-page .muted-note {
    font-size: 0.68rem;
    line-height: 1.3;
}

.signup-request-page .account-request-identity {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
    border-left-width: 1px;
    border-radius: 10px;
}

.signup-request-page .account-request-identity strong,
.signup-request-page .account-request-identity small {
    display: block;
}

.signup-request-comment {
    margin-top: 0.75rem;
    border-top: 1px solid var(--line);
    padding-top: 0.65rem;
}

.signup-request-comment summary {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    width: fit-content;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.signup-request-comment summary span {
    padding: 0.14rem 0.38rem;
    border-radius: 999px;
    color: var(--teal);
    background: color-mix(in srgb, var(--teal) 10%, transparent);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.signup-request-comment[open] summary {
    margin-bottom: 0.6rem;
}

.signup-request-side {
    position: static;
    display: grid;
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-self: stretch;
}

.signup-request-form.is-expanded .signup-request-side {
    position: sticky;
    top: 5.2rem;
    height: auto;
    grid-template-rows: auto auto;
    align-self: start;
}

.signup-dodo-stage {
    display: grid;
    min-height: 0;
    place-items: end center;
    overflow: hidden;
}

.signup-request-dodo {
    width: min(11rem, 100%);
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.42));
}

.signup-request-form.is-expanded .signup-request-dodo {
    width: min(15rem, 100%);
}

.signup-request-summary {
    display: grid;
    gap: 0.28rem;
    padding: 0.72rem 0.8rem;
}

.signup-request-summary strong {
    font-size: 0.94rem;
}

.signup-request-summary small {
    color: var(--muted);
    font-size: 0.68rem;
}

.signup-request-summary .cf-turnstile {
    max-width: 100%;
    overflow: hidden;
}

.signup-request-complete {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.8rem;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}

.signup-request-complete .button {
    min-width: 11rem;
}

.signup-request-complete .login-small-link {
    order: -1;
    margin-right: auto;
}

@media (max-width: 980px) {
    .signup-request-form {
        grid-template-columns: minmax(0, 1fr) 15rem;
    }

    .signup-request-page .access-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .signup-request-page .access-type-option {
        min-height: 5.6rem;
    }
}

@media (max-width: 760px) {
    .signup-request-shell {
        padding: 0.9rem 0.7rem 5.5rem;
        background-attachment: scroll;
    }

    .signup-request-heading {
        gap: 0.75rem;
        margin-bottom: 0.8rem;
    }

    .signup-request-logo {
        width: 6.5rem;
    }

    .signup-request-heading h1 {
        font-size: 1.75rem;
    }

    .signup-request-heading p:last-child {
        font-size: 0.78rem;
    }

    .signup-request-form {
        grid-template-columns: 1fr;
    }

    .signup-request-side {
        position: static;
        grid-template-columns: 7rem minmax(0, 1fr);
        grid-template-rows: auto;
        height: auto;
        align-items: end;
    }

    .signup-request-form.is-expanded .signup-request-side {
        position: static;
        height: auto;
        grid-template-rows: auto;
    }

    .signup-dodo-stage {
        min-height: 0;
    }

    .signup-request-dodo {
        width: 7rem;
    }
}

@media (max-width: 520px) {
    .signup-request-heading {
        align-items: flex-start;
    }

    .signup-request-logo {
        width: 5.2rem;
    }

    .signup-request-heading .eyebrow {
        font-size: 0.58rem;
    }

    .signup-request-heading h1 {
        font-size: 1.5rem;
    }

    .signup-request-page .access-type-grid,
    .signup-account-choice,
    .signup-request-page .field-grid {
        grid-template-columns: 1fr;
    }

    .signup-request-page .access-type-option {
        min-height: 0;
        grid-template-columns: 2.35rem minmax(0, 1fr);
    }

    .signup-existing-account {
        align-items: stretch;
        flex-direction: column;
    }

    .signup-request-side {
        display: block;
        height: 4rem;
    }

    .signup-dodo-stage {
        height: 4rem;
    }

    .signup-request-dodo {
        width: 5rem;
    }

    .signup-request-form.is-expanded .signup-request-dodo {
        width: 5rem;
    }

    .signup-request-summary {
        display: none;
    }
}

/* Calendar audit: primary schedule first, compact utilities and student day details. */
.teacher-calendar-page .calendar-hero,
.student-calendar-view .student-calendar-hero {
    min-height: 0;
    padding-block: 1rem 1.15rem;
}

.teacher-calendar-page .calendar-hero h1,
.student-calendar-view .student-calendar-hero h1 {
    margin-block: .12rem .2rem;
}

.calendar-primary-stack {
    display: grid;
    gap: 1rem;
}

.teacher-calendar-page .calendar-panel {
    min-width: 0;
}

.calendar-week-panel .teacher-week-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem 1rem;
}

.calendar-week-panel .week-toolbar {
    grid-column: 1;
    grid-row: 1;
    width: min(32rem, 100%);
    margin: 0;
}

.calendar-week-panel .week-mode-toggle {
    grid-column: 2;
    grid-row: 1;
}

.calendar-week-panel .teacher-week {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
}

.calendar-utility-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, .8fr);
    gap: 1rem;
    align-items: stretch;
}

.calendar-next-panel,
.calendar-google-card {
    min-width: 0;
    height: 100%;
}

.calendar-next-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
}

.calendar-next-list li {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
    min-width: 0;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.calendar-next-list time {
    display: grid;
    gap: .02rem;
    justify-items: center;
    padding-right: .55rem;
    border-right: 1px solid var(--line);
}

.calendar-next-list time strong {
    color: var(--gold);
    font-size: .92rem;
}

.calendar-next-list time span,
.calendar-next-list li > div > span {
    color: var(--muted);
    font-size: .78rem;
}

.calendar-next-list li > div {
    display: grid;
    gap: .08rem;
    min-width: 0;
}

.calendar-next-list li > div > strong,
.calendar-next-list li > div > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-other-events {
    margin-top: .65rem;
}

.calendar-other-events .action-list {
    margin-top: .5rem;
}

.calendar-other-events .action-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
}

.calendar-other-events .action-list li > div:first-child {
    display: grid;
    gap: .08rem;
    min-width: 0;
}

.calendar-other-events .action-list li > div:first-child span {
    color: var(--muted);
    font-size: .82rem;
}

.calendar-empty-note {
    display: grid;
    min-height: 6rem;
    place-items: center;
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.calendar-google-card .compact-heading {
    align-items: center;
}

.calendar-google-email {
    overflow: hidden;
    color: var(--text) !important;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-google-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.calendar-google-actions > *,
.calendar-google-actions .button {
    width: 100%;
}

.calendar-google-preferences {
    margin-top: .15rem;
}

.calendar-preferences-form {
    display: grid;
    gap: .65rem;
    padding-top: .65rem;
}

.calendar-preferences-form fieldset {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.calendar-preferences-form legend,
.calendar-preferences-form > label {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.calendar-preferences-form .preference-pills label {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    gap: .35rem;
    padding: .42rem .65rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    cursor: pointer;
}

.calendar-preferences-form .preference-pills input {
    width: 1rem;
    height: 1rem;
    min-height: 1rem;
    margin: 0;
    padding: 0;
    accent-color: var(--gold);
}

.calendar-preferences-form select {
    min-height: 2.6rem;
}

.calendar-management-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    align-items: start;
}

.calendar-management-card {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.calendar-management-card > summary {
    display: flex;
    min-height: 3.4rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .72rem .85rem;
}

.calendar-management-card > summary > span:first-child {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: .55rem;
    color: var(--text);
    font-weight: 900;
}

.calendar-management-body {
    display: grid;
    gap: .75rem;
    padding: .2rem .85rem .9rem;
}

.calendar-guide-card {
    grid-column: 1 / -1;
}

.calendar-guide-card .calendar-management-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-guide-card .calendar-management-body p {
    margin: 0;
    color: var(--muted);
}

.student-calendar-page {
    grid-template-columns: minmax(0, 980px);
}

.student-upcoming-lessons {
    display: grid;
    gap: .65rem;
}

.student-upcoming-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}

.student-upcoming-list article {
    display: grid;
    grid-template-columns: 3.1rem minmax(0, 1fr);
    gap: .6rem;
    align-items: center;
    min-width: 0;
    padding: .62rem .68rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
}

.student-upcoming-list time {
    display: grid;
    justify-items: center;
    padding-right: .5rem;
    border-right: 1px solid var(--line);
}

.student-upcoming-list time strong {
    color: var(--gold);
}

.student-upcoming-list time span,
.student-upcoming-list article small {
    color: var(--muted);
    font-size: .78rem;
}

.student-upcoming-list article > div:not(.student-upcoming-actions) {
    display: grid;
    min-width: 0;
}

.student-upcoming-actions {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: .5rem;
}

.student-upcoming-actions:empty {
    display: none;
}

.student-upcoming-actions a {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.student-day-links {
    margin-top: .45rem;
    justify-content: flex-start;
}

.student-day-links .button {
    display: inline-flex;
    width: auto;
}

@media (max-width: 980px) {
    .calendar-utility-grid,
    .calendar-management-grid {
        grid-template-columns: 1fr;
    }

    .calendar-guide-card {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    .teacher-calendar-page .calendar-hero,
    .student-calendar-view .student-calendar-hero {
        padding-block: .7rem .8rem;
    }

    .calendar-primary-stack,
    .calendar-utility-grid,
    .calendar-management-grid {
        gap: .72rem;
    }

    .calendar-week-panel .teacher-week-shell {
        grid-template-columns: 1fr;
    }

    .calendar-week-panel .week-toolbar,
    .calendar-week-panel .week-mode-toggle,
    .calendar-week-panel .teacher-week {
        grid-column: 1;
        grid-row: auto;
    }

    .calendar-week-panel .week-mode-toggle {
        justify-self: center;
    }

    .calendar-week-panel .teacher-week {
        grid-template-columns: repeat(7, minmax(5.6rem, 1fr));
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: .1rem .1rem .45rem;
        scroll-snap-type: x proximity;
    }

    .calendar-week-panel .teacher-week-day {
        min-height: 7rem;
        scroll-snap-align: start;
    }

    .calendar-next-list,
    .student-upcoming-list,
    .calendar-guide-card .calendar-management-body {
        grid-template-columns: 1fr;
    }

    .calendar-google-actions {
        grid-template-columns: 1fr;
    }

    .calendar-management-card > summary {
        align-items: flex-start;
    }

    .reschedule-request-card {
        grid-template-columns: 1fr;
    }

    .student-upcoming-list article {
        grid-template-columns: 3.1rem minmax(0, 1fr) auto;
    }

    .student-upcoming-actions {
        grid-column: 3;
        justify-content: flex-end;
    }

    .day-popover {
        position: fixed !important;
        top: auto !important;
        right: .5rem !important;
        bottom: calc(4.9rem + env(safe-area-inset-bottom)) !important;
        left: .5rem !important;
        width: auto;
        max-height: min(68dvh, 30rem);
        border-radius: 12px;
    }
}

@media (max-width: 440px) {
    .student-upcoming-list article {
        grid-template-columns: 3.1rem minmax(0, 1fr);
    }

    .student-upcoming-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .calendar-management-card > summary .status-chip {
        font-size: .68rem;
    }
}

/* Material editor: progressive, compact controls. */
.material-more-options-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, .72fr);
    gap: .7rem;
    padding-top: .65rem;
}

.material-item-name-edit-form {
    grid-template-columns: minmax(6rem, 1fr) minmax(7rem, .52fr);
    gap: .3rem;
}

.material-item-name-edit-form > select {
    min-width: 0;
}

@media (max-width: 700px) {
    .material-more-options-grid,
    .material-item-name-edit-form {
        grid-template-columns: 1fr;
    }
}

/* 2026-08: leitura rápida da home e fluxos de acesso. */
.home-simple .home-section-heading h2,
.home-simple .home-section-heading p,
.home-simple-card p,
.home-simple-cta p {
    margin-block: 0;
}

.home-simple-hero {
    min-height: min(34rem, calc(100svh - 4.5rem));
}

.home-simple-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(18rem, 0.7fr);
    gap: clamp(1rem, 3vw, 3rem);
    align-items: center;
    min-height: min(34rem, calc(100svh - 4.5rem));
    padding-block: clamp(1rem, 2.5vw, 1.75rem);
}

.home-simple-hero .home-hero-copy > p:not(.eyebrow) {
    max-width: 38rem;
}

.home-simple-dodo-stage {
    position: relative;
    display: grid;
    min-height: 25rem;
    place-items: center;
}

.home-simple-dodo {
    position: relative;
    z-index: 2;
    max-width: min(23rem, 92%);
}

.home-simple-promise {
    position: absolute;
    right: 4%;
    bottom: 7%;
    z-index: 3;
    display: grid;
    gap: 0.12rem;
    min-width: 13rem;
    padding: 0.68rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
    box-shadow: var(--shadow);
}

.home-simple-promise strong { color: var(--text); }
.home-simple-promise span { color: var(--teal); font-size: 0.78rem; font-weight: 850; }

.home-quick-start {
    padding: clamp(2rem, 5vw, 3.5rem) 1rem;
}

.home-heading-compact {
    gap: 0.22rem;
    margin-bottom: 1rem;
}

.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.home-quick-card,
.home-simple-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.home-quick-card::before,
.home-simple-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--orange, #e77824), var(--teal));
}

.home-quick-card {
    display: grid;
    min-height: 8.2rem;
    gap: 0.22rem;
    align-content: center;
    justify-items: center;
    padding: 0.85rem;
    text-align: center;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.home-quick-card:hover,
.home-quick-card:focus-visible {
    border-color: color-mix(in srgb, var(--gold) 48%, var(--line));
    background: color-mix(in srgb, var(--gold) 8%, var(--surface));
    transform: translateY(-2px);
}

.home-quick-card > .nav-icon {
    width: 1.35rem;
    height: 1.35rem;
    margin-bottom: 0.25rem;
    color: var(--gold);
}

.home-quick-card.is-student > .nav-icon { color: var(--teal); }
.home-quick-card.is-teacher > .nav-icon { color: var(--blue); }
.home-quick-card.is-tools > .nav-icon { color: var(--rose); }
.home-quick-card strong { font-size: 1rem; }
.home-quick-card small { color: var(--muted); font-size: 0.72rem; }

.home-demo-disclosure {
    width: min(48rem, 100%);
    margin: 0.75rem auto 0;
}

.home-demo-disclosure > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    width: fit-content;
    min-height: 2.8rem;
    margin-inline: auto;
    padding: 0.45rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    cursor: pointer;
    list-style: none;
}

.home-demo-disclosure > summary::-webkit-details-marker { display: none; }
.home-demo-disclosure > summary > .nav-icon { color: var(--gold); }
.home-demo-disclosure > summary > span:nth-child(2) { display: grid; gap: 0.02rem; }
.home-demo-disclosure > summary strong { font-size: 0.82rem; }
.home-demo-disclosure > summary small { color: var(--muted); font-size: 0.66rem; }
.home-demo-disclosure > summary > span:last-child { color: var(--gold); font-size: 1.25rem; transition: transform 160ms ease; }
.home-demo-disclosure[open] > summary > span:last-child { transform: rotate(90deg); }

.home-demo-disclosure-body {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.6rem;
    animation: home-demo-reveal 180ms ease-out both;
}

.home-demo-fictional {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.7rem;
}

.home-demo-fictional strong {
    padding: 0.18rem 0.42rem;
    border: 1px solid color-mix(in srgb, var(--orange, #e77824) 58%, var(--line));
    border-radius: 999px;
    color: var(--orange, #e77824);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-demo-disclosure .home-material-demo { width: 100%; margin: 0; }
.home-demo-disclosure .home-demo-heading h3 { margin: 0; font-size: clamp(1rem, 2.5vw, 1.35rem); }
.home-demo-disclosure .home-demo-heading p { margin: 0.1rem 0 0; }

@keyframes home-demo-reveal {
    from { opacity: 0; transform: translateY(-0.25rem); }
    to { opacity: 1; transform: translateY(0); }
}

.home-simple-feature {
    display: grid;
    gap: 1rem;
}

.home-simple-card-grid {
    display: grid;
    gap: 0.65rem;
}

.home-simple-card-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-simple-card-grid.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.home-simple-card {
    display: grid;
    min-height: 8.8rem;
    gap: 0.35rem;
    align-content: start;
    padding: 0.9rem;
}

.home-simple-card > .nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--gold);
}

.home-simple-card p { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.home-simple-card.accent-material > .nav-icon,
.home-simple-card.accent-message > .nav-icon { color: var(--rose); }
.home-simple-card.accent-calendar > .nav-icon { color: var(--teal); }
.home-simple-card.accent-billing > .nav-icon { color: var(--green); }
.home-simple-card.accent-students > .nav-icon { color: var(--blue); }

.home-simple-cta {
    min-height: 0;
    margin-top: 0;
    padding: 0.85rem 1rem;
}

.home-tools-simple {
    min-height: 0;
}

@media (min-width: 760px) and (max-width: 1120px) {
    .is-authenticated .site-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.35rem;
    }

    .is-authenticated .brand-text { display: none; }
    .authenticated-main-nav { gap: 0.12rem; }
    .authenticated-main-nav > * + * { margin-left: 0.12rem; padding-left: 0.12rem; }
    .is-authenticated .account-nav { gap: 0.3rem; }
    .is-authenticated .account-nav > * + * { margin-left: 0.22rem; padding-left: 0.22rem; }
    .active-access-chip { max-width: 2.55rem; padding-inline: 0.42rem; }
    .active-access-chip > span:nth-child(2) { display: none; }
}

@media (min-width: 760px) and (max-width: 940px) {
    .authenticated-main-nav > a,
    .authenticated-submenu > summary {
        width: 2.2rem;
        justify-content: center;
        gap: 0;
        font-size: 0;
    }

    .authenticated-main-nav .nav-icon { margin: 0; }
    .authenticated-submenu > summary::after { display: none; }
}

@media (max-width: 820px) {
    .home-simple-hero-grid { grid-template-columns: 1fr; }
    .home-simple-dodo-stage { min-height: 15rem; }
    .home-simple-dodo { max-width: 14rem; }
    .home-simple-promise { right: 8%; bottom: 2%; }
    .home-quick-grid,
    .home-simple-card-grid.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .home-simple-hero { min-height: 0; }
    .home-simple-hero-grid { min-height: 0; gap: 0.4rem; padding-block: 0.7rem 1rem; }
    .home-simple-hero .home-hero-copy { padding-top: 0.65rem; }
    .home-simple-hero .home-hero-copy h1 { font-size: clamp(2rem, 10.5vw, 3rem); }
    .home-simple-dodo-stage { min-height: 11.5rem; }
    .home-simple-dodo { max-width: 10.5rem; transform: translateX(-1.4rem); }
    .home-simple-promise { right: 0; bottom: 0.8rem; min-width: 11.5rem; padding: 0.52rem 0.65rem; }
    .home-quick-start { padding-block: 1.5rem; }
    .home-quick-grid { gap: 0.45rem; }
    .home-quick-card { min-height: 7rem; padding: 0.65rem 0.4rem; }
    .home-quick-card small { max-width: 10rem; }
    .home-simple-card-grid.three-columns,
    .home-simple-card-grid.four-columns { grid-template-columns: 1fr; }
    .home-simple-card { min-height: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
    .home-simple-card > .nav-icon { grid-row: 1 / 3; margin: 0 0.35rem 0 0; }
.home-simple-card p { grid-column: 2; }
}

/* 2026-08: nova home orientada por produto e por perfil. */
.home-v3 {
    background:
        radial-gradient(circle at 86% 5%, rgba(57, 166, 183, .1), transparent 25rem),
        radial-gradient(circle at 10% 32%, rgba(244, 179, 33, .065), transparent 28rem),
        var(--bg);
}

.home-v3-hero {
    min-height: min(39rem, calc(100svh - 4rem));
}

.home-v3-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, .88fr) minmax(29rem, 1.12fr);
    gap: clamp(1.5rem, 4vw, 4.5rem);
    align-items: center;
    min-height: min(39rem, calc(100svh - 4rem));
    padding-block: clamp(1.1rem, 3vw, 2.25rem);
}

.home-v3-hero-copy {
    position: relative;
    z-index: 3;
}

.home-v3-hero-copy h1 {
    max-width: 35rem;
    margin: 0;
    font-size: clamp(2.4rem, 4.25vw, 3.85rem);
    line-height: .98;
    letter-spacing: -.05em;
    text-transform: none;
}

.home-v3-hero-copy .eyebrow { margin: 0 0 .7rem; }
.home-v3-hero-copy .home-hero-logo { width: min(12rem, 60vw); margin-bottom: -.55rem; }
.home-v3-lead { max-width: 36rem; margin: 1rem 0 0; color: var(--muted); font-size: clamp(.98rem, 1.55vw, 1.12rem); line-height: 1.52; }

.home-v3-product-stage {
    position: relative;
    min-width: 0;
    padding: 4.8rem 1rem 1.2rem 0;
}

.home-v3-demo-label {
    position: absolute;
    z-index: 4;
    top: 3.5rem;
    left: 1rem;
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    padding: .28rem .55rem;
    border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
    border-radius: 999px;
    background: rgba(7, 8, 10, .78);
    color: var(--gold);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.home-v3-demo-label > span { width: .38rem; height: .38rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 .2rem rgba(64, 209, 177, .12); }

.home-v3-today-card {
    position: relative;
    z-index: 2;
    display: grid;
    gap: .85rem;
    overflow: hidden;
    padding: clamp(1rem, 2.4vw, 1.35rem);
    border: 1px solid rgba(247, 248, 250, .18);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(244, 179, 33, .92), rgba(64, 209, 177, .62)) top / 100% 1px no-repeat,
        rgba(15, 17, 20, .96);
    box-shadow: 0 1.8rem 4.5rem rgba(0, 0, 0, .42);
    backdrop-filter: blur(14px);
}

.home-v3-today-card > header,
.home-v3-today-card > footer,
.home-v3-study-line,
.home-v3-today-actions {
    display: flex;
    gap: .8rem;
    align-items: center;
}

.home-v3-today-card > header { justify-content: space-between; padding-right: 5.7rem; }
.home-v3-today-card > header > div { display: grid; gap: .12rem; }
.home-v3-today-card > header small { color: var(--gold); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.home-v3-today-card > header strong { font-size: clamp(1rem, 2vw, 1.3rem); }
.home-v3-today-card > header > span { color: var(--muted); font-size: .66rem; white-space: nowrap; }

.home-v3-study-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.home-v3-study-line > div { display: grid; min-width: 0; gap: .12rem; }
.home-v3-study-line > div strong,
.home-v3-study-line > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-v3-study-line > div small { color: var(--muted); font-size: .76rem; }
.home-v3-study-line > b { color: var(--green); }
.home-v3 .home-demo-note { display: grid; width: 2.45rem; height: 2.45rem; place-items: center; border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--line)); border-radius: 50%; color: var(--gold); background: rgba(244, 179, 33, .08); font-size: 1.35rem; transform: none; }
.home-v3 .home-demo-note > span { line-height: 1; transform: translate(.04rem, .18rem); }
.public-home .site-header { position: fixed; inset: 0 0 auto; z-index: 80; width: 100%; box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .2); }
.public-home main { padding-top: 4.45rem; }
.home-v3-hero-copy .button-primary .nav-icon { color: var(--bg); }
.home-v3-hero-copy .button-secondary .nav-icon { color: var(--gold); }

.home-v3-today-actions { flex-wrap: wrap; }
.home-v3-today-actions > span { display: inline-flex; gap: .45rem; align-items: center; min-height: 2.2rem; padding: .42rem .62rem; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: rgba(255, 255, 255, .025); font-size: .76rem; font-weight: 800; }

.home-v3-today-card > footer { justify-content: space-between; padding-top: .75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.home-v3-today-card > footer > span { display: inline-flex; gap: .42rem; align-items: center; }
.home-v3-today-card > footer .nav-icon { width: 1rem; height: 1rem; color: var(--blue); }
.home-v3-ready { color: var(--green); font-weight: 850; }
.home-v3-hero-dodo { position: absolute; z-index: 3; top: -.6rem; right: -1rem; width: clamp(8.5rem, 14vw, 11.5rem); pointer-events: none; filter: drop-shadow(0 1rem 1.6rem rgba(0, 0, 0, .42)); }

.home-v3-paths { padding: clamp(1.6rem, 4vw, 2.8rem) 1rem; border-bottom: 1px solid var(--line); }
.home-v3-heading { display: grid; gap: .18rem; margin-bottom: 1rem; }
.home-v3-heading h2,
.home-v3-heading p { margin: 0; }
.home-v3-heading h2 { font-size: clamp(1.65rem, 3vw, 2.45rem); line-height: 1.06; }
.home-v3-heading p { margin-top: .35rem; color: var(--muted); }
.home-v3-heading-centered { justify-items: center; text-align: center; }

.home-v3-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.home-v3-path { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; min-height: 5.5rem; padding: .9rem 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(16, 18, 21, .86); text-decoration: none; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.home-v3-path::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--gold), var(--teal)); }
.home-v3-path:hover,
.home-v3-path:focus-visible { border-color: color-mix(in srgb, currentColor 45%, var(--line)); background: color-mix(in srgb, currentColor 6%, var(--surface)); transform: translateY(-2px); }
.home-v3-path > .nav-icon,
.home-v3-path > .home-v3-teacher-icon { width: 1.45rem; height: 1.45rem; color: var(--gold); }
.home-v3-path.is-student > .nav-icon { color: var(--teal); }
.home-v3-path.is-teacher > .home-v3-teacher-icon { color: var(--blue); }
.home-v3-path.is-tools > .nav-icon { color: var(--rose); }
.home-v3-path > span:nth-child(2) { display: grid; min-width: 0; gap: .1rem; }
.home-v3-path strong { font-size: .94rem; }
.home-v3-path small { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.home-v3-path > b { color: var(--gold); font-size: 1.35rem; }

.home-v3-audience-section { background: rgba(255, 255, 255, .012); }
.home-v3-audience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.home-v3-audience-card { position: relative; display: grid; gap: 1rem; align-content: start; padding: clamp(1rem, 2.5vw, 1.4rem); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(16, 18, 21, .88); }
.home-v3-audience-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); }
.home-v3-audience-card.is-teacher::before { background: linear-gradient(90deg, var(--gold), var(--blue), transparent); }
.home-v3-audience-card > header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: center; }
.home-v3-role-icon { display: grid; width: 2.65rem; height: 2.65rem; place-items: center; border: 1px solid color-mix(in srgb, var(--teal) 38%, var(--line)); border-radius: 11px; color: var(--teal); background: rgba(57, 166, 183, .07); }
.home-v3-role-icon > .nav-icon { width: 1.18rem; height: 1.18rem; }
.home-v3-role-icon.is-teacher { border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, transparent); }
.home-v3-teacher-icon { display: inline-grid; width: 1.45rem; height: 1.45rem; place-items: center; color: currentColor; }
.home-v3-teacher-icon svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.home-v3-audience-card > header small { color: var(--muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.home-v3-audience-card h3 { margin: .12rem 0 0; font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.home-v3-audience-card ul { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.home-v3-audience-card li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; align-items: center; min-height: 3.45rem; padding: .55rem .65rem; border: 1px solid rgba(247, 248, 250, .075); border-radius: 10px; background: rgba(255, 255, 255, .018); }
.home-v3-audience-card li > .nav-icon { width: 1.15rem; height: 1.15rem; color: var(--gold); }
.home-v3-audience-card li > span:last-child { display: grid; gap: .08rem; }
.home-v3-audience-card li strong { font-size: .86rem; }
.home-v3-audience-card li small { color: var(--muted); font-size: .72rem; }

.home-v3-detail-demo { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(7, 8, 10, .4); }
.home-v3-detail-demo > summary { display: flex; justify-content: space-between; gap: .8rem; align-items: center; min-height: 2.8rem; padding: .62rem .75rem; color: var(--gold); cursor: pointer; font-size: .8rem; font-weight: 850; list-style: none; }
.home-v3-detail-demo > summary::-webkit-details-marker { display: none; }
.home-v3-detail-demo > summary span { font-size: 1.2rem; transition: transform 160ms ease; }
.home-v3-detail-demo[open] > summary { border-bottom: 1px solid var(--line); }
.home-v3-detail-demo[open] > summary span { transform: rotate(90deg); }
.home-v3-detail-body { display: grid; gap: .55rem; padding: .75rem; }
.home-v3-detail-body > p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.home-v3-detail-demo:not([open]) .home-demo-progress > span { width: 0; animation: none; }
.home-v3-detail-demo[open] .home-demo-progress > span { animation: home-demo-progress-fill 1.35s cubic-bezier(.2, .76, .18, 1) both; }
.home-v3-example-label { width: max-content; max-width: 100%; padding: .2rem .42rem; border: 1px solid color-mix(in srgb, var(--orange, #e77824) 52%, var(--line)); border-radius: 999px; color: var(--orange, #e77824); font-size: .6rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.home-v3-finance-demo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-v3-finance-demo > .home-v3-example-label,
.home-v3-finance-demo > p { grid-column: 1 / -1; }
.home-v3-finance-demo > div { display: grid; gap: .08rem; padding: .55rem; border: 1px solid var(--line); border-radius: 8px; }
.home-v3-finance-demo > div span { color: var(--muted); font-size: .65rem; }
.home-v3-finance-demo > div strong { font-size: .9rem; }
.home-v3-finance-demo > div.is-open strong { color: var(--rose); }
.home-v3-audience-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.home-v3-audience-actions .button { flex: 1; min-width: 10rem; }

.home-v3-connected { border-block: 1px solid var(--line); }
.home-v3-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.home-v3-feature-grid article { display: grid; gap: .18rem; justify-items: center; min-height: 7rem; align-content: center; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .018); text-align: center; }
.home-v3-feature-grid .nav-icon { width: 1.35rem; height: 1.35rem; margin-bottom: .25rem; color: var(--gold); }
.home-v3-feature-grid article:nth-child(2) .nav-icon { color: var(--rose); }
.home-v3-feature-grid article:nth-child(3) .nav-icon { color: var(--blue); }
.home-v3-feature-grid article:nth-child(4) .nav-icon { color: var(--green); }
.home-v3-feature-grid small { color: var(--muted); font-size: .7rem; }

.home-v3-tools { padding-block: clamp(2rem, 5vw, 3.5rem); }
.home-v3-tools-panel { position: relative; display: grid; grid-template-columns: minmax(15rem, .4fr) minmax(0, 1fr); gap: clamp(1rem, 4vw, 2.5rem); align-items: center; min-height: 15rem; padding: 1.2rem clamp(1rem, 4vw, 2rem); overflow: hidden; border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); border-radius: 17px; background: linear-gradient(115deg, rgba(244, 179, 33, .08), rgba(57, 166, 183, .045)), var(--surface); }
.home-v3-tools-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--gold), var(--teal)); }
.home-v3-tools-showcase { position: relative; min-height: 12rem; }
.home-v3-tools-dodo { position: absolute; z-index: 2; left: -.35rem; top: 1rem; width: 8.8rem; margin: 0; filter: drop-shadow(0 .7rem 1rem rgba(0, 0, 0, .32)); }
.home-v3-metronome-demo { position: absolute; z-index: 1; top: .35rem; right: .3rem; display: grid; width: 7.4rem; justify-items: center; color: var(--gold); text-decoration: none; filter: drop-shadow(0 .7rem 1rem rgba(0, 0, 0, .26)); transition: transform 160ms ease, color 160ms ease; }
.home-v3-metronome-demo:hover,
.home-v3-metronome-demo:focus-visible { color: var(--orange, #e77824); transform: translateY(-2px); }
.home-v3-mechanical-shell { position: relative; display: block; width: 7.4rem; height: 8.7rem; --mechanical-duration: 1.1s; }
.home-v3-mechanical-shell > .mechanical-metronome { position: absolute; top: 0; left: 50%; transform: translateX(-50%) scale(.59); transform-origin: top center; }
.home-v3-metronome-label { margin-top: -.2rem; padding: .2rem .45rem; border: 1px solid color-mix(in srgb, currentColor 45%, var(--line)); border-radius: 999px; background: rgba(7, 8, 10, .62); font-size: .62rem; font-weight: 850; }
.home-v3-tools-panel h2 { margin: .2rem 0 0; font-size: clamp(1.55rem, 3vw, 2.4rem); }
.home-v3-tools-panel p { max-width: 40rem; margin: .5rem 0 1rem; color: var(--muted); }
.home-v3-tools-panel .eyebrow { display: inline-flex; gap: .45rem; align-items: center; }
.home-v3-tools-panel .home-inline-actions { justify-content: flex-start; }

.home-v3-install { padding-block: 1rem 2rem; }
.home-v3-install-panel { display: grid; grid-template-columns: auto minmax(0, 24rem) auto; gap: .9rem; justify-content: center; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); }
.home-v3-install-panel h2,
.home-v3-install-panel p { margin: 0; }
.home-v3-install-panel h2 { font-size: 1.25rem; }
.home-v3-install-panel p { margin-top: .15rem; color: var(--muted); font-size: .78rem; }

.home-v3-rafael { background: rgba(255, 255, 255, .012); }
.home-v3-rafael-grid { display: grid; grid-template-columns: minmax(15rem, .58fr) minmax(0, 1fr); gap: clamp(1.4rem, 5vw, 4rem); align-items: center; }
.home-v3-rafael-grid > img { display: block; width: 100%; max-height: 24rem; object-fit: cover; object-position: center 28%; border: 1px solid var(--line); border-radius: 16px; }
.home-v3-rafael-grid h2 { margin: .2rem 0 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.home-v3-rafael-grid p { max-width: 36rem; margin: .55rem 0 1rem; color: var(--muted); }
.home-v3-rafael-grid .home-inline-actions { justify-content: flex-start; }
.home-v3-rafael-grid > div > small { display: block; margin-top: .65rem; color: var(--muted); }

@media (max-width: 900px) {
    .reschedule-request-card {
        grid-template-columns: 1fr;
    }

    .home-v3-hero-grid,
    .home-v3-rafael-grid { grid-template-columns: 1fr; }
    .home-v3-hero-grid { min-height: 0; }
    .home-v3-product-stage { width: min(42rem, 100%); margin-inline: auto; }
    .home-v3-path-grid { grid-template-columns: 1fr; }
    .home-v3-path { min-height: 4.6rem; }
}

@media (max-width: 700px) {
    .home-v3-audience-grid { grid-template-columns: 1fr; }
    .home-v3-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-v3-tools-panel { grid-template-columns: minmax(12rem, .42fr) minmax(0, 1fr); }
    .home-v3-tools-dodo { left: -1rem; }
    .home-v3-metronome-demo { right: -.7rem; }
}

@media (max-width: 560px) {
    .public-home main { padding-top: 4.15rem; }
    .home-v3-hero { min-height: 0; }
    .home-v3-hero-grid { gap: .2rem; padding-block: .75rem 1.1rem; }
    .home-v3-hero-copy .home-hero-logo { width: 9.75rem; }
    .home-v3-hero-copy .eyebrow { margin-bottom: .45rem; }
    .home-v3-hero-copy h1 { max-width: 24rem; font-size: clamp(2.05rem, 10.5vw, 2.85rem); }
    .home-v3-lead { margin-top: .7rem; font-size: .88rem; }
    .home-v3-hero-copy .home-hero-actions { display: grid; gap: .45rem; margin-top: .85rem; }
    .home-v3-hero-copy .home-hero-actions .button { width: 100%; min-height: 2.75rem; }
    .home-v3-product-stage { padding: 4.1rem 0 0; }
    .home-v3-demo-label { top: 3.15rem; left: .45rem; }
    .home-v3-hero-dodo { top: 0; right: -.4rem; width: 7.5rem; }
    .home-v3-today-card { gap: .65rem; padding: .8rem; border-radius: 13px; }
    .home-v3-today-card > header { padding-right: 4.1rem; }
    .home-v3-today-card > header > span { display: none; }
    .home-v3-today-card > header strong { font-size: .94rem; }
    .home-v3-study-line { gap: .55rem; }
    .home-v3 .home-demo-note { width: 2.1rem; height: 2.1rem; font-size: 1.15rem; }
    .home-v3-today-actions > span { flex: 1; justify-content: center; }
    .home-v3-today-card > footer { align-items: flex-start; flex-direction: column; gap: .35rem; }
    .home-v3-paths { padding-block: 1.35rem; }
    .home-v3-heading { margin-bottom: .75rem; }
    .home-v3-heading h2 { font-size: 1.55rem; }
    .home-v3-path { padding: .72rem .8rem; }
    .home-v3-audience-card { padding: .85rem; border-radius: 13px; }
    .home-v3-audience-card h3 { font-size: 1.32rem; }
    .home-v3-finance-demo { grid-template-columns: 1fr; }
    .home-v3-finance-demo > .home-v3-example-label,
    .home-v3-finance-demo > p { grid-column: 1; }
    .home-v3-feature-grid { gap: .45rem; }
    .home-v3-feature-grid article { min-height: 6rem; padding: .55rem; }
    .home-v3-tools-panel { grid-template-columns: 1fr; padding: 1rem; text-align: center; }
    .home-v3-tools-showcase { width: min(16rem, 100%); min-height: 8.8rem; margin-inline: auto; }
    .home-v3-tools-dodo { left: .2rem; top: -.35rem; width: 7.5rem; }
    .home-v3-metronome-demo { top: -.65rem; right: .35rem; width: 6rem; }
    .home-v3-mechanical-shell { width: 6rem; height: 7.3rem; }
    .home-v3-mechanical-shell > .mechanical-metronome { transform: translateX(-50%) scale(.49); }
    .home-v3-tools-panel .eyebrow,
    .home-v3-tools-panel .home-inline-actions { justify-content: center; }
    .home-v3-tools-panel .home-inline-actions { display: grid; }
    .home-v3-tools-panel .home-inline-actions .button { width: 100%; }
    .home-v3-install-panel { grid-template-columns: auto minmax(0, 1fr); }
    .home-v3-install-panel > .button { grid-column: 1 / -1; width: 100%; }
    .home-v3-rafael-grid > img { max-height: 17rem; }
    .home-v3-rafael-grid .home-inline-actions { display: grid; }
    .home-v3-rafael-grid .home-inline-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .home-v3-mechanical-shell .mechanical-arm { animation: none; transform: translateX(-50%) rotate(0); }
}

/* Estudo unificado: o aluno vê primeiro somente o que precisa agora. */
.student-page .student-study-overview {
    grid-column: 1 / -1;
    order: 1;
    display: grid;
    gap: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    scroll-margin-top: 5rem;
}

.student-page .streak-panel,
.student-page .streak-off-panel { order: 2; }
.student-page .student-calendar-card { order: 3; }

.study-overview-header,
.study-now-heading {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.study-overview-header {
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid var(--line);
}

.study-overview-header h2,
.study-now-heading h3,
.study-now-heading p,
.study-flat-group h4,
.study-flat-body p,
.study-simple-empty p {
    margin-block: 0;
}

.study-overview-header h2 { margin-top: 0.12rem; font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
.study-now { position: relative; padding: 0.9rem 0.95rem 1rem; }
.study-now-heading { margin-bottom: 0.72rem; }
.study-now-heading h3 { font-size: 1.05rem; }
.study-now-heading p,
.study-now-heading small { color: var(--muted); font-size: 0.74rem; }
.study-legacy-anchor { position: absolute; top: -5.5rem; }
.study-now-note { margin-bottom: 0.7rem; }

.study-flat-groups {
    display: grid;
    gap: 0.78rem;
}

.study-flat-group {
    display: grid;
    gap: 0.3rem;
}

.study-flat-group h4 {
    padding-inline: 0.18rem;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.study-flat-items {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.study-flat-item {
    border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.study-flat-item:last-child { border-bottom: 0; }
.study-flat-item > summary {
    display: grid;
    grid-template-columns: 0.7rem minmax(0, 1fr);
    gap: 0.48rem;
    align-items: center;
    min-height: 3.25rem;
    padding: 0.45rem 0.62rem;
    cursor: pointer;
    list-style: none;
}

.study-flat-item > summary::-webkit-details-marker { display: none; }
.study-flat-copy { display: grid; min-width: 0; gap: 0.08rem; }
.study-flat-copy strong,
.study-flat-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-flat-copy strong { font-size: 0.9rem; }
.study-flat-copy small { color: var(--muted); font-size: 0.72rem; }
.study-flat-copy .study-current-content { color: var(--teal); }

.study-flat-chevron {
    width: 0.42rem;
    height: 0.42rem;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 150ms ease;
}

.study-flat-item[open] .study-flat-chevron { transform: rotate(45deg); }
.study-flat-item > summary > .summary-progress {
    grid-column: 2;
    width: 100%;
}

.study-flat-body {
    display: grid;
    gap: 0.58rem;
    padding: 0.2rem 0.72rem 0.78rem 1.8rem;
}

.study-flat-body > p { color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.study-simple-empty { display: grid; gap: 0.35rem; justify-items: start; padding: 0.8rem; color: var(--muted); }

.study-overview-section {
    position: relative;
    border-top: 1px solid var(--line);
}

.study-overview-section > summary,
.study-history-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 3.6rem;
    padding: 0.68rem 0.95rem;
    color: inherit;
    cursor: pointer;
    list-style: none;
    text-decoration: none;
}

.study-overview-section > summary::-webkit-details-marker { display: none; }
.study-overview-section > summary > span:first-child,
.study-history-link > span:nth-child(2) { display: grid; gap: 0.08rem; }
.study-overview-section small,
.study-history-link small { color: var(--muted); font-size: 0.7rem; }
.study-overview-count { color: var(--gold); font-size: 0.75rem; font-weight: 850; }
.study-overview-section[open] .study-overview-count { font-size: 0; }
.study-overview-section[open] .study-overview-count::after { content: "Fechar"; font-size: 0.75rem; }
.study-overview-body { padding: 0 0.95rem 0.95rem; }

.study-history-link {
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-top: 1px solid var(--line);
}

.study-history-link > .nav-icon { color: var(--blue); }
.study-history-link > span:last-child { color: var(--gold); font-size: 1.4rem; }

.student-home-page .streak-hero,
.student-home-page .goal-confetti-side { display: none; }
.student-home-page .streak-panel { gap: 0.55rem; padding: 0.78rem 0.9rem; }
.student-home-page .streak-panel .panel-heading { align-items: center; }
.student-home-page .week-row { margin-top: 0; }

.teacher-study-complete {
    display: block;
}

.teacher-study-complete > summary {
    cursor: pointer;
    list-style: none;
}

.teacher-study-complete > summary::-webkit-details-marker { display: none; }
.teacher-study-complete-summary {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    padding: 0.8rem 0.95rem;
}

.teacher-study-complete-summary > span:first-child { display: grid; gap: 0.1rem; }
.teacher-study-complete-summary small { color: var(--muted); font-size: 0.72rem; }
.teacher-study-complete-summary > span:last-child { color: var(--gold); font-size: 0.75rem; font-weight: 850; }
.teacher-study-complete[open] .teacher-study-complete-summary > span:last-child { font-size: 0; }
.teacher-study-complete[open] .teacher-study-complete-summary > span:last-child::after { content: "Fechar"; font-size: 0.75rem; }
.teacher-study-complete-body { margin-top: 0.65rem; }

.weekly-plan-panel .study-area-list { gap: 0.55rem; }
.weekly-plan-panel .study-area-card { border-radius: 9px; }
.weekly-plan-panel .study-area-card > summary { min-height: 2.65rem; padding-block: 0.45rem; }
.weekly-plan-panel .study-item-card > summary { min-height: 3rem; padding-block: 0.42rem; }
.weekly-plan-panel .study-item-card > summary small { font-size: 0.7rem; }

.dashboard-compact-details > summary {
    cursor: pointer;
    list-style: none;
}

.dashboard-compact-details > summary::-webkit-details-marker { display: none; }
.dashboard-compact-details:not([open]) { padding-bottom: 0.85rem; }
.dashboard-compact-details:not([open]) > summary { margin-bottom: 0; }

@media (max-width: 620px) {
    .study-overview-header { padding: 0.72rem; }
    .study-now { padding: 0.75rem 0.72rem 0.82rem; }
    .study-now-heading { align-items: flex-start; }
    .study-now-heading small { text-align: right; }
    .study-flat-item > summary { min-height: 3rem; padding: 0.38rem 0.5rem; }
    .study-flat-body { padding: 0.15rem 0.58rem 0.68rem 1.55rem; }
    .study-overview-section > summary,
    .study-history-link { padding-inline: 0.72rem; }
    .study-overview-body { padding-inline: 0.72rem; }
}

/* Fluxo minimalista de solicitação de acesso */
.signup-wizard-shell {
    display: grid;
    min-height: calc(100svh - 4.1rem);
    place-items: center;
    padding: 1rem;
}

.signup-wizard-wrap {
    position: relative;
    width: min(62rem, 100%);
}

.signup-wizard {
    position: relative;
    display: grid;
    min-height: 27rem;
    place-items: center;
    isolation: isolate;
}

.signup-wizard-step {
    position: relative;
    z-index: 2;
    width: min(48rem, 100%);
}

.signup-wizard-step[hidden] {
    display: none;
}

.signup-wizard-heading {
    margin-bottom: 1.1rem;
    text-align: center;
}

.signup-wizard-heading h1,
.signup-wizard-heading h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3.2vw, 2.35rem);
    line-height: 1.05;
    text-transform: none;
}

.signup-wizard-choice-grid {
    display: grid;
    gap: 0.7rem;
}

.signup-wizard-access-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.signup-wizard-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(34rem, 100%);
    margin-inline: auto;
}

.signup-wizard-choice {
    --wizard-color: var(--gold);
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 8rem;
    place-items: center;
    align-content: center;
    gap: 0.55rem;
    padding: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.signup-wizard-choice::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: var(--wizard-color);
}

.signup-wizard-choice:hover,
.signup-wizard-choice:focus-visible {
    border-color: color-mix(in srgb, var(--wizard-color) 75%, var(--line));
    background: color-mix(in srgb, var(--wizard-color) 9%, var(--surface));
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
    outline: none;
    transform: translateY(-4px);
}

.signup-wizard-choice.choice-student { --wizard-color: #66d6c6; }
.signup-wizard-choice.choice-teacher { --wizard-color: var(--gold); }
.signup-wizard-choice.choice-school { --wizard-color: #68a7ff; }
.signup-wizard-choice.choice-other { --wizard-color: #e77824; }
.signup-wizard-choice.choice-existing { --wizard-color: var(--teal); }
.signup-wizard-choice.choice-new { --wizard-color: var(--gold); }

.signup-wizard-choice > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.signup-wizard-choice-icon {
    display: inline-grid;
    width: 3.15rem;
    height: 3.15rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--wizard-color) 62%, var(--line));
    border-radius: 50%;
    color: var(--wizard-color);
    background: color-mix(in srgb, var(--wizard-color) 10%, transparent);
}

.signup-wizard-choice-icon .nav-icon {
    transform: scale(1.18);
}

.signup-wizard-choice strong,
.signup-wizard-choice small {
    display: block;
}

.signup-wizard-choice strong {
    font-size: 0.98rem;
}

.signup-wizard-choice small {
    margin-top: -0.5rem;
    color: var(--muted);
    font-size: 0.68rem;
}

.signup-wizard-account-choice {
    min-height: 9rem;
    border: 1px solid var(--line);
    font: inherit;
}

.signup-wizard-dodo {
    position: absolute;
    z-index: 1;
    top: -3.3rem;
    right: -4.8rem;
    width: 10rem;
    pointer-events: none;
    filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.42));
}

.signup-wizard[data-current-step="details"] .signup-wizard-dodo {
    top: -1.5rem;
    right: -3rem;
    width: 7rem;
    opacity: 0.5;
}

.signup-wizard-back {
    display: inline-flex;
    gap: 0.28rem;
    align-items: center;
    margin: 0 0 0.65rem;
    padding: 0.25rem 0.45rem;
    border: 0;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
}

.signup-wizard-back span {
    color: var(--gold);
    font-size: 1.35rem;
    line-height: 0.7;
}

.signup-wizard-back:hover {
    color: var(--text);
}

.signup-wizard-details {
    width: min(50rem, 100%);
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: var(--shadow);
}

.signup-wizard-details::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, var(--gold), var(--teal), transparent 88%);
}

.signup-wizard-details .signup-wizard-heading {
    margin-bottom: 0.85rem;
    text-align: left;
}

.signup-wizard-details .signup-wizard-heading h2 {
    font-size: 1.3rem;
}

.signup-wizard-fields,
.signup-wizard-request-fields {
    display: grid;
    gap: 0.65rem;
}

.signup-wizard-request-fields:not(:empty) {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}

.signup-wizard-current-account {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--bg) 60%, var(--surface));
}

.signup-wizard-current-account small,
.signup-wizard-current-account strong {
    display: block;
}

.signup-wizard-current-account small {
    color: var(--muted);
    font-size: 0.65rem;
}

.signup-wizard-complete {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.signup-wizard-complete .button {
    min-width: 12rem;
}

@media (max-width: 1080px) {
    .signup-wizard-dodo {
        top: -4.5rem;
        right: 0;
        width: 7rem;
    }
}

@media (max-width: 620px) {
    .signup-wizard-shell {
        min-height: calc(100svh - 4.1rem);
        padding: 0.7rem;
    }

    .signup-wizard {
        min-height: 32rem;
    }

    .signup-wizard-step {
        padding-top: 1.2rem;
    }

    .signup-wizard-heading {
        max-width: 17rem;
        margin: 0 auto 0.85rem;
    }

    .signup-wizard-heading h1,
    .signup-wizard-heading h2 {
        font-size: 1.55rem;
    }

    .signup-wizard-access-grid,
    .signup-wizard-account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .signup-wizard-choice,
    .signup-wizard-account-choice {
        min-height: 7.2rem;
        padding: 0.65rem;
    }

    .signup-wizard-choice-icon {
        width: 2.75rem;
        height: 2.75rem;
    }

    .signup-wizard-dodo,
    .signup-wizard[data-current-step="details"] .signup-wizard-dodo {
        top: -2.6rem;
        right: -0.15rem;
        width: 5.2rem;
        opacity: 0.8;
    }

    .signup-wizard-details {
        padding: 0.8rem;
    }

    .signup-wizard-details .signup-wizard-heading {
        max-width: none;
        margin-inline: 0;
    }

    .signup-wizard-details .field-grid {
        grid-template-columns: 1fr;
    }

    .signup-wizard-complete .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .signup-wizard-choice {
        transition: none;
    }

    .signup-wizard-choice:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .signup-request-page .access-type-option,
    .signup-account-option {
        transition: none;
    }

    .signup-request-page .access-type-option:hover,
    .signup-account-option:hover {
        transform: none;
    }
}

.student-limited-access-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem;
    border: 1px solid color-mix(in srgb, var(--blue) 38%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--blue) 6%, transparent);
}

.student-limited-access-summary > div {
    display: grid;
    gap: 0.2rem;
}

.student-limited-access-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Keep one-time greetings and navigation fully inside small viewports. */
@media (max-width: 759px) {
    .welcome-modal {
        align-items: center;
        padding:
            max(0.75rem, env(safe-area-inset-top))
            max(0.75rem, env(safe-area-inset-right))
            max(0.75rem, env(safe-area-inset-bottom))
            max(0.75rem, env(safe-area-inset-left));
    }

    .welcome-card {
        max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .welcome-confetti {
        overflow: hidden;
    }

    .welcome-form {
        gap: 0.55rem;
        padding: 1.15rem 0.95rem 1rem;
    }

    .welcome-symbol-wrap {
        width: 5.15rem;
    }

    .welcome-card h2 {
        font-size: clamp(1.65rem, 8vw, 2.2rem);
        line-height: 1.08;
    }

    .welcome-card p {
        font-size: 0.9rem;
        line-height: 1.42;
    }

    .public-mobile-menu-panel {
        position: fixed;
        top: calc(4.25rem + env(safe-area-inset-top));
        right: max(0.75rem, env(safe-area-inset-right));
        left: auto;
        width: min(18rem, calc(100vw - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
        max-height: calc(100dvh - 5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .mobile-tabbar-panel {
        max-height: calc(100dvh - 6rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}
.security-secret {
    display: block;
    max-width: 100%;
    margin-top: 0.45rem;
    padding: 0.55rem 0.7rem;
    overflow-wrap: anywhere;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    font-size: 0.86rem;
    letter-spacing: 0.08em;
}

.security-secret-uri {
    letter-spacing: 0;
}

/* Tablet landscape: switch to the compact bottom navigation before the header can collide. */
@media (min-width: 760px) and (max-width: 940px) {
    .is-authenticated { padding-bottom: calc(4.8rem + env(safe-area-inset-bottom)); }
    .is-authenticated .site-header { grid-template-columns: minmax(0, 1fr) auto; }
    .is-authenticated .main-nav { display: none; }
    .is-authenticated .account-nav { grid-column: 2; }
    .mobile-tabbar.mobile-tabbar-compact {
        position: fixed;
        right: max(.8rem, env(safe-area-inset-right));
        bottom: max(.65rem, env(safe-area-inset-bottom));
        left: max(.8rem, env(safe-area-inset-left));
        z-index: 55;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: .28rem;
        padding: .42rem;
        overflow: visible;
        border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
        border-radius: 18px;
        background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
        box-shadow: 0 18px 48px rgba(0, 0, 0, .46);
        backdrop-filter: blur(18px);
    }
    .mobile-tabbar-compact > .mobile-tabbar-item,
    .mobile-tabbar-compact > .mobile-tabbar-menu,
    .mobile-tabbar-compact > .mobile-tabbar-menu > .mobile-tabbar-item { width: 100%; min-width: 0; }
    .mobile-tabbar-menu { position: relative; display: grid; min-width: 0; }
    .mobile-tabbar-item {
        position: relative;
        display: grid;
        min-height: 3rem;
        place-items: center;
        padding: .32rem .1rem;
        border: 1px solid transparent;
        border-radius: 14px;
        color: var(--muted);
        background: transparent;
        font: inherit;
        font-size: .62rem;
        font-weight: 800;
        text-decoration: none;
    }
    .mobile-tabbar-item .nav-icon { width: 1.28rem; height: 1.28rem; }
    .mobile-tabbar-menu.is-active > .mobile-tabbar-item,
    .mobile-tabbar-menu[open] > .mobile-tabbar-item,
    .mobile-tabbar-item.is-active { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
    .mobile-tabbar-panel {
        position: absolute;
        bottom: calc(100% + .7rem);
        left: 0;
        z-index: 65;
        display: grid;
        gap: .22rem;
        width: min(17rem, calc(100vw - 2rem));
        max-height: calc(100dvh - 6rem);
        padding: .52rem;
        overflow-y: auto;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: color-mix(in srgb, var(--surface-strong) 97%, #000);
        box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
    }
    .mobile-tabbar-panel-right { right: 0; left: auto; }
    .mobile-tabbar-panel a,
    .mobile-tabbar-panel button {
        display: flex;
        width: 100%;
        min-height: 2.55rem;
        align-items: center;
        gap: .62rem;
        padding: .5rem .62rem;
        border: 0;
        border-radius: 8px;
        color: var(--muted);
        background: transparent;
        font: inherit;
        font-size: .88rem;
        font-weight: 800;
        text-align: left;
        text-decoration: none;
    }
}

/* Mensagens individuais e barra responsiva de alunos. */
.student-detail-actions {
    grid-template-columns: repeat(3, 10.4rem);
}

.student-detail-actions > .student-message-action {
    grid-column: 1;
    grid-row: 1;
}

.student-detail-actions > .student-edit-action {
    grid-column: 2;
    grid-row: 1;
}

.student-detail-actions > .student-archive-action {
    grid-column: 3;
    grid-row: 1;
}

.student-communication-email-option,
.communication-form .student-communication-email-option {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
    cursor: pointer;
}

.student-communication-email-option input {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 1.05rem;
    margin-top: 0.12rem;
    padding: 0;
    accent-color: var(--gold);
}

.student-communication-email-option > span {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.student-communication-email-option small,
.student-communication-history .field-help,
.student-communication-log small {
    color: var(--muted);
}

.student-communication-history {
    width: min(920px, 100%);
}

.student-communication-log {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.student-communication-log details {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-soft);
}

.student-communication-log summary {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.72rem 0.8rem;
    cursor: pointer;
}

.student-communication-log summary > span:first-child {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.student-communication-log-body {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 0.8rem;
    border-top: 1px solid var(--line);
}

.student-communication-log-body p {
    margin: 0;
}

.student-communication-log-body li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: center;
    padding: 0.4rem 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.student-communication-log-body li small {
    flex: 1 1 100%;
}

@media (min-width: 761px) {
    .student-subnav {
        width: 100%;
    }

    .student-subnav button {
        min-width: 0;
        flex: 1 1 0;
        justify-content: center;
        padding-inline: .45rem;
        text-align: center;
        white-space: normal;
    }

    .student-subnav-divider {
        flex: 0 0 auto;
    }
}

@media (max-width: 960px) {
    .student-list-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .student-list-toolbar .student-live-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .student-detail-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-detail-actions > .student-message-action {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .student-detail-actions > .student-edit-action {
        grid-column: 1;
        grid-row: 2;
    }

    .student-detail-actions > .student-archive-action {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 520px) {
    .student-list-toolbar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .student-list-toolbar .view-toggle {
        justify-self: start;
    }

    .student-list-toolbar > .button {
        width: 100%;
        justify-self: stretch;
    }

    .student-communication-log summary {
        align-items: flex-start;
    }
}

/* Calendar page source order must not inherit the dashboard card order. */
.student-calendar-view .student-calendar-page .student-calendar-main-card {
    order: initial;
}

/* Global legal documents and versioned acceptance. */
.site-legal-footer {
    display: flex;
    width: min(100% - 2rem, 1540px);
    min-height: 3.4rem;
    margin: 1.5rem auto 0;
    padding: 0.85rem 0 1.2rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}

.site-legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.site-legal-footer a { color: var(--muted); }
.site-legal-footer a:hover { color: var(--gold); }

.legal-page-shell {
    display: grid;
    width: min(100% - 2rem, 980px);
    margin: 0 auto;
    padding: clamp(1.1rem, 3vw, 2.6rem) 0;
    gap: 1rem;
}

.legal-page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 11rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
    gap: 1rem;
    overflow: hidden;
}

.legal-page-hero h1,
.legal-simple-heading h1 {
    margin: 0.25rem 0 0.45rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 0.98;
}

.legal-page-hero p,
.legal-simple-heading p { max-width: 42rem; margin: 0; color: var(--muted); }
.legal-page-hero small { display: block; margin-top: 0.85rem; color: var(--muted); }
.legal-page-dodo { flex: 0 0 auto; }

.legal-acceptance-status,
.legal-review-callout {
    display: flex;
    min-height: 2.8rem;
    padding: 0.7rem 0.9rem;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--gold) 8%, var(--surface));
    color: var(--text);
}

.legal-acceptance-status.is-accepted { border-color: color-mix(in srgb, var(--mint) 46%, var(--line)); }
.legal-acceptance-status.is-accepted span { color: var(--mint); font-weight: 900; }
.legal-acceptance-status a,
.legal-review-callout { color: var(--gold); font-weight: 800; }

.legal-section-stack { display: grid; gap: 0.75rem; }
.legal-section-card { padding: clamp(1rem, 2vw, 1.35rem); }
.legal-section-card h2 { margin: 0 0 0.55rem; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.legal-section-card p { margin: 0.4rem 0; color: var(--muted); line-height: 1.6; }
.legal-section-card ul { display: grid; margin: 0.65rem 0 0; padding-left: 1.2rem; gap: 0.42rem; color: var(--muted); line-height: 1.5; }
.legal-section-card li::marker { color: var(--gold); }

.legal-page-footer {
    display: flex;
    padding: 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.legal-page-footer div { display: grid; gap: 0.15rem; }
.legal-page-footer span { color: var(--muted); }
.legal-simple-heading { padding: 0.4rem 0 0.8rem; }

.legal-acceptance-shell { max-width: 820px; }
.legal-acceptance-form { display: grid; padding: clamp(1rem, 3vw, 1.5rem); gap: 1rem; }
.legal-acceptance-list { display: grid; gap: 0.7rem; }
.legal-acceptance-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 5rem;
    padding: 0.9rem;
    align-items: start;
    gap: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
    cursor: pointer;
}

.legal-acceptance-option:has(input:checked) {
    border-color: var(--mint);
    background: color-mix(in srgb, var(--mint) 8%, var(--surface-strong));
}

.legal-acceptance-option input { margin-top: 0.2rem; }
.legal-acceptance-option span { display: grid; gap: 0.28rem; }
.legal-acceptance-option small { color: var(--muted); line-height: 1.4; }
.legal-acceptance-option a { width: max-content; color: var(--gold); font-size: 0.82rem; font-weight: 800; }
.legal-acceptance-note { margin: 0; color: var(--muted); font-size: 0.82rem; }
.legal-acceptance-form > .button { justify-self: end; }

.legal-all-set { display: grid; padding: 1.5rem; justify-items: center; gap: 0.8rem; text-align: center; }
.legal-all-set-check { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--mint) 18%, var(--surface)); color: var(--mint); font-size: 1.5rem; font-weight: 900; }

.legal-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.legal-document-card { display: grid; padding: 1.15rem; align-content: start; gap: 0.65rem; }
.legal-document-card h2,
.legal-document-card p { margin: 0; }
.legal-document-card p,
.legal-document-card small { color: var(--muted); }
.legal-document-card .status-chip { justify-self: start; }
.legal-document-card .button { justify-self: start; margin-top: 0.25rem; }
.legal-history-card { padding: 1rem 1.15rem; }
.legal-history-card summary { color: var(--text); font-weight: 850; cursor: pointer; }
.legal-history-card ul { display: grid; margin: 1rem 0 0; padding: 0; gap: 0.55rem; list-style: none; }
.legal-history-card li { display: flex; padding-top: 0.55rem; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); }
.legal-history-card li span,
.legal-history-card p,
.legal-contact-line { color: var(--muted); }
.legal-contact-line { margin: 0; font-size: 0.82rem; }
.legal-contact-line a { color: var(--gold); }

@media (max-width: 680px) {
    .site-legal-footer { padding-bottom: calc(5.3rem + env(safe-area-inset-bottom)); }
    .legal-page-hero { grid-template-columns: minmax(0, 1fr) 5.2rem; min-height: 9rem; }
    .legal-page-dodo { transform: scale(0.82); transform-origin: center right; }
    .legal-document-grid { grid-template-columns: 1fr; }
    .legal-page-footer,
    .legal-history-card li { align-items: flex-start; flex-direction: column; }
    .legal-page-footer .button,
    .legal-acceptance-form > .button { width: 100%; justify-self: stretch; }
}
