.phrases-page {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 560px;
    padding: 0 8px 8px;
}

.phrases-level-tabs {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 -8px 8px;
    min-height: clamp(52px, 9svh, 70px);
    position: sticky;
    top: 65px;
    z-index: 9;
}

.phrases-road {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.phrases-topic {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.phrases-topic h1 {
    background: rgb(220 244 255 / 78%);
    border: 1px solid rgb(119 199 255 / 58%);
    border-radius: 16px;
    box-sizing: border-box;
    color: #c12ada;
    font-size: clamp(23px, 4.8vw, 28px);
    font-weight: 900;
    line-height: 1.15;
    margin: 10px 0 0;
    padding: 14px 12px;
    text-align: center;
}

.phrase-lesson {
    align-items: stretch;
    display: grid;
    gap: clamp(4px, 1.8vw, 12px);
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    margin: 5px 0;
    min-height: clamp(144px, 30vw, 178px);
}

.phrase-lesson-side {
    align-items: center;
    display: flex;
    min-width: 0;
}

.phrase-lesson--image-right .phrase-lesson-side:last-child,
.phrase-lesson--image-left .phrase-lesson-side:first-child {
    justify-content: center;
}

.phrase-lesson-image {
    border: 2px solid rgb(255 255 255 / 72%);
    border-radius: 18px;
    box-shadow: 0 2px 4px rgb(0 0 0 / 16%);
    box-sizing: border-box;
    display: block;
    height: auto;
    max-width: min(100%, 210px);
    object-fit: contain;
    width: min(100%, clamp(158px, 42vw, 210px));
}

.phrase-lesson-rail {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.phrase-lesson-rail span {
    background: rgb(255 255 255 / 72%);
    border-radius: 999px;
    flex: 0 1 clamp(28px, 8vw, 48px);
    width: 5px;
}

.phrase-lesson-rail b {
    align-items: center;
    background: #ffcb05;
    border: 2px solid rgb(255 255 255 / 72%);
    border-radius: 999px;
    color: #174ea6;
    display: flex;
    font-family: "Nunito", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.phrase-lesson-card {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: clamp(82px, 23vw, 92px);
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    padding: 14px 13px 10px;
    position: relative;
    width: 100%;
}

.phrase-lesson--current .phrase-lesson-card {
    border-color: rgb(255 203 5 / 86%);
    box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
}

.phrase-lesson-card h2 {
    color: #5c40f2;
    font-family: "Nunito", Arial, sans-serif;
    font-size: clamp(16px, 5.1vw, 20px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
    max-height: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-align: left;
    width: 100%;
}

.phrase-lesson-card p {
    color: #4f5054;
    font-size: clamp(16px, 4.8vw, 18px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    max-height: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-align: left;
    width: 100%;
}

.phrase-lesson-stack {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    width: min(100%, clamp(158px, 42vw, 210px));
}

.phrase-lesson-translate {
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    background: rgb(220 244 255 / 90%);
    border: 2px solid rgb(119 199 255 / 70%);
    border-radius: 10px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 8px;
    top: -12px;
    transition: transform 0.08s ease, filter 0.08s ease, background-color 0.08s ease;
    width: 30px;
    z-index: 2;
}

.phrase-lesson-translate[aria-expanded="true"] {
    background: #ffeb66;
    border-color: #f3ca32;
}

.phrase-lesson-card--translated {
    background: rgb(238 255 249 / 78%);
    border-color: rgb(108 215 204 / 72%);
}

.phrase-lesson-translate:active {
    filter: brightness(0.96);
    transform: translateY(1px) scale(0.98);
}

.phrase-lesson-translate img {
    display: block;
    height: 18px;
    width: 18px;
}

.phrase-lesson-action {
    align-self: stretch;
    border: 2px solid rgb(255 255 255 / 72%);
    font-size: clamp(14px, 3.6vw, 15px);
    letter-spacing: 0.8px;
    min-height: 32px;
    min-width: 0;
    padding: 9px 12px 7px;
    text-decoration: none;
    width: 100%;
}

html[lang="ka"] .phrase-lesson-action {
    font-weight: 600;
    letter-spacing: 1px;
}

html[lang="ka"] .phrase-lesson-rail b,
html[lang="ka"] .phrase-lesson-card h2 {
    font-family: "Nunito", Arial, sans-serif;
    font-weight: 900 !important;
    letter-spacing: 0;
}

.phrase-lesson-action--start {
    background: #20cf1e;
    border-color: rgb(255 255 255 / 72%);
    color: #fff;
}

.phrase-lesson-action--repeat {
    background: #ff9b2f;
    color: #fff;
}

.phrase-lesson-action--done {
    background: #d8e6eb;
    color: #60727e;
}

.phrase-lesson-action--inactive {
    background: #d8e6eb;
    color: #73828b;
    cursor: default;
    pointer-events: none;
}

.phrases-empty-card {
    color: #2f5d6b;
    font-size: clamp(13px, 3.8vw, 15px);
    font-weight: 800;
    line-height: 1.3;
}

.phrases-intro {
    background: rgb(255 244 191 / 76%);
    border-bottom: 1px solid rgb(182 213 255 / 70%);
    border-radius: 16px;
    border-top: 1px solid rgb(182 213 255 / 50%);
    box-shadow: 0 1px 2px rgb(0 0 0 / 16%);
    box-sizing: border-box;
    margin: 10px 0 0;
    padding: 14px 13px;
}

.phrases-intro h1 {
    color: #423f52;
    font-size: clamp(18px, 5vw, 21px);
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
}

.phrases-intro p {
    color: #748060;
    font-size: clamp(12px, 3.4vw, 14px);
    font-weight: 800;
    line-height: 1.38;
    margin: 7px 0 0;
}
