    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      height: 100%;
      margin: 0;
      overflow: hidden;
      font-family: Arial, sans-serif;
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      background: #eaeaea;
    }

    .page {
      width: 100%;
      height: 100%;
      max-width: 480px;
      background: white;

      display: flex;
      flex-direction: column;
    }

    @media (max-width: 480px) {
      .page {
        max-width: none;
      }
    }

	.header {
		position: relative;

		height: 60px;
		flex-shrink: 0;

		background: #333;
		color: white;

		display: flex;
		align-items: center;
		justify-content: center;
	}
	.header-title {
		max-width: 70%;
	}
	.menu-btn {
		position: absolute;

		right: 10px;
		top: 10px;

		width: 40px;
		height: 40px;

		border: 1px solid #777;
		border-radius: 6px;

		display: flex;
		align-items: center;
		justify-content: center;

		cursor: pointer;

		font-size: 22px;

		user-select: none;
	}

	.menu-btn:hover {
		background: #444;
	}
	
	.popup-menu {
		position: absolute;

		top: 55px;
		right: 10px;

		min-width: 180px;

		background: white;
		color: black;

		border: 1px solid #888;
		border-radius: 8px;

		display: none;

		overflow: hidden;

		box-shadow: 0 4px 10px rgba(0,0,0,0.3);

		z-index: 1000;
	}

	.menu-item {
		padding: 12px;

		cursor: pointer;
	}

	.menu-item:hover {
		background: #eeeeee;
	}
	
	.app-icon {
		position: absolute;

		left: 10px;
		top: 10px;

		width: 40px;
		height: 40px;

		border: 1px solid #777;
		border-radius: 6px;

		display: flex;
		align-items: center;
		justify-content: center;

		user-select: none;
	}
	.app-icon img {
		width: 38px;
		height: 38px;
		border-radius: 6px;
	}

    .content {
      flex: 1;
      min-height: 0;
      padding: 16px;
      overflow: hidden;
    }
	
	/*полоса процентов*/
    .footer {
		height: 60px;
		flex-shrink: 0;

		display: flex;
		align-items: center;
		justify-content: center;

		padding: 0 16px;
	}

	.progress {
		position: relative;

		width: 80%;
		height: 24px;

		border: 1px solid #888;
		border-radius: 12px;

		overflow: hidden;
	}

	.progress-bar {
		height: 100%;
		width: 0%;

		background: #4caf50;

		transition: width 0.3s;
	}

	.progress-text {
		position: absolute;

		left: 0;
		top: 0;

		width: 100%;
		height: 100%;

		display: flex;
		align-items: center;
		justify-content: center;

		font-size: 14px;
		font-weight: bold;

		color: black;
	}
	
	/*выбор слов*/
	.lesson {
		width: 100%;
		height: 100%;

		display: flex;
		flex-direction: column;
		align-items: center;

		padding: 20px;
		box-sizing: border-box;
	}

	.question {
		width: 80%;
		font-size: 1.5rem;
		text-align: center;
	}

	.spacer {
		flex: 1;
	}

	.answer {
		width: 90%;
		min-height: 60px;

		display: flex;
		align-items: center;
		justify-content: center;

		margin-bottom: 12px;
		padding: 8px;

		border: 1px solid #888;
		border-radius: 8px;

		cursor: pointer;
		user-select: none;

		font-size: 1.2rem;
	}

	.answer:last-child {
		margin-bottom: 0;
	}
	
	.lesson-list {
		width: 100%;
		height: 100%;

		overflow-y: auto;

		display: flex;
		flex-direction: column;
		align-items: center;

		padding: 20px;
		box-sizing: border-box;
	}

	.course-empty {
		max-width: 320px;
		margin: auto;
		padding: 28px 22px;
		border: 1px solid #d8d8d8;
		border-radius: 16px;
		background: #fafafa;
		text-align: center;
	}

	.course-empty-icon {
		font-size: 2.6rem;
	}

	.course-empty h2 {
		margin: 14px 0 8px;
		font-size: 1.35rem;
	}

	.course-empty p {
		margin: 0;
		color: #666;
		line-height: 1.5;
	}


	/* выбор упражнений */
	.task-page {
		width: 100%;
		height: 100%;

		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto 1fr 1fr;

		gap: 16px;
		padding: 16px;

		box-sizing: border-box;
	}

	.task-card {
		min-width: 0;
		min-height: 0;

		border-radius: 12px;
		padding: 12px;

		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		color: white;
		text-align: center;

		cursor: pointer;
		user-select: none;

		box-sizing: border-box;
	}
	
	.task-card-special {
		grid-column: 1 / -1;
		grid-row: 1;

		background: #607d8b;
		min-height: 80px;

		/* иконка слева, надпись справа */
		flex-direction: row;
		gap: 12px;
	}

	.task-card-special .task-caption {
		margin-top: 0;
	}

	.task-icon {
		font-size: 2.4rem;
		font-weight: bold;
	}

	.task-caption {
		margin-top: 8px;
		font-size: 0.9rem;
	}

	.task-card:nth-child(1) {
		background: #4caf50;
	}

	.task-card:nth-child(2) {
		background: #2196f3;
	}

	.task-card:nth-child(3) {
		background: #ff9800;
	}

	.task-card:nth-child(4) {
		background: #9c27b0;
	}

	.task-card:nth-child(1),
	.task-card:nth-child(2) {
		grid-row: 2;
	}

	.task-card:nth-child(3),
	.task-card:nth-child(4) {
		grid-row: 3;
	}
	
	/*упражнение писать слово*/
	.write-lesson {
		width: 100%;
		height: 100%;

		display: flex;
		flex-direction: column;
		align-items: center;

		padding: 16px;
	}

	.write-question {
		width: 90%;
		text-align: center;
		font-size: 1.5rem;
		margin-top: 20px;
	}

	.write-input {
		width: 90%;
		min-height: 50px;

		margin-top: 30px;
		padding: 10px;
		
		border-bottom: 2px solid #333;

		font-size: 1.6rem;
		text-align: center;
	}

	.keyboard {
		width: 100%;

		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 8px;
	}

	.key {
		min-height: 48px;

		display: flex;
		align-items: center;
		justify-content: center;

		border: 1px solid #888;
		border-radius: 8px;

		font-size: 1.6rem;
		cursor: pointer;
		user-select: none;
	}

	.key-ok {
		background: #4caf50;
		color: white;
	}

	.key-back {
		background: #f44336;
		color: white;
		font-size: 1.6rem;
	}
	.key-help {
		background: #2196f3;
		color: white;
		font-size: 1.6rem;
	}
	
	/*предложения*/
	
	.sentence-lesson {
		width: 100%;
		height: 100%;

		display: flex;
		flex-direction: column;
		align-items: center;

		padding: 0px;
	}

	.sentence-variants {
		width: 100%;
		height: 60%;

		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: repeat(4, 1fr);

		gap: 8px;
	}

	.sentence-btn {
		display: flex;
		align-items: center;
		justify-content: center;

		border: 1px solid #888;
		border-radius: 8px;

		cursor: pointer;
		user-select: none;

		font-size: 1.3rem;
	}
	
	.sentence-empty {
		visibility: hidden;
		pointer-events: none;
	}


	.sentence-undo {
		width: 48px;
		min-height: 44px;

		margin-left: 6px;

		border-radius: 8px;
		background: #eeeeee;

		display: flex;
		align-items: center;
		justify-content: center;

		cursor: pointer;
		user-select: none;

		font-size: 1.6rem;
	}

	.sentence-undo:hover {
		background: #eeeeee;
	}
	
	
	.sentence-question {
		width: 100%;

		margin-top: 0px;

		font-size: 1.3rem;
		text-align: left;
	}

	.sentence-answer-block {
		width: 100%;

		margin-top: 6px;
	}


	.sentence-input {
		flex: 1;

		min-height: 44px;
		padding: 10px;

		background: #eeeeee;
		display: flex;
		align-items: center;
		justify-content: flex-start;
		flex-wrap: wrap;

		font-size: 1.3rem;
		text-align: left;

		border-radius: 8px;
	}
	
	.sentence-input-row {
		width: 100%;

		display: flex;
		align-items: stretch;
	}


	.sentence-correct {
		display: none;

		width: 100%;
		min-height: 44px;

		margin-top: 6px;
		padding: 10px;

		border-radius: 8px;

		background: #c8f7c5;

		font-size: 1.2rem;
		text-align: left;
	}
	
	/**/
	
	.sentence-progress {
		width: 100%;
		height: 24px;

		display: grid;
		grid-template-columns: repeat(100, 1fr);

		border: 1px solid #888;
		border-radius: 8px;
		overflow: hidden;
	}

	.progress-cell {
		background: #eeeeee;
		border-right: 1px solid #ddd;
	}

	.progress-cell:last-child {
		border-right: none;
	}

	.progress-current {
		background: #2196f3;
	}

	.progress-ok {
		background: #4caf50;
	}

	.progress-bad {
		background: #f44336;
	}
	
	
	#sentenceProgress {
		display: none;
	}
	
	#wordProgress {
		display: block;
	}
	
	
	#motivationPopup {
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translateX(-50%) scale(.5);

		background: #4caf50;
		color: white;

		padding: 18px 35px;
		border-radius: 12px;

		font-size: 24px;
		font-weight: bold;
		text-align: center;

		box-shadow: 0 8px 30px rgba(0,0,0,.3);

		opacity: 0;
		visibility: hidden;

		transition: .25s;

		z-index: 999999;
		pointer-events: none;
	}

	#motivationPopup.show {
		opacity: 1;
		visibility: visible;
		transform: translateX(-50%) scale(1);
	}
	/**/
	
	.task-progress {
		position: relative;

		width: 80%;
		height: 18px;

		margin-top: 14px;

		background: rgba(255,255,255,0.35);
		border-radius: 9px;

		overflow: hidden;
	}

	.task-progress-bar {
		height: 100%;
		background: rgba(255,255,255,0.85);
	}

	.task-progress-text {
		position: absolute;
		inset: 0;

		display: flex;
		align-items: center;
		justify-content: center;

		font-size: 12px;
		font-weight: bold;

		color: #222;
	}
	/**/

	.lesson-btn {
		width: 90%;

		margin: 10px auto;
		padding: 14px;

		border: 1px solid #888;
		border-radius: 8px;

		cursor: pointer;
	}

	.lesson-btn:hover {
		background: #f0f0f0;
	}

	.lesson-btn:last-child {
		margin-bottom: 0;
	}

	.lesson-name {
		font-size: 1.2rem;
		font-weight: bold;
	}

	.lesson-caption {
		margin-top: 6px;
		color: #666;
	}

	.lesson-progress {
		position: relative;

		width: 100%;
		height: 18px;

		margin-top: 12px;

		background: #e5e5e5;
		border-radius: 9px;

		overflow: hidden;
	}

	.lesson-progress-bar {
		height: 100%;
		background: #4caf50;
	}

	.lesson-progress-text {
		position: absolute;

		inset: 0;

		display: flex;
		align-items: center;
		justify-content: center;

		font-size: 12px;
		font-weight: bold;
	}	
	/**/
	.audio-question {
		width: 90%;
		min-height: 80px;

		display: flex;
		align-items: center;
		justify-content: center;

		font-size: 3rem;

		cursor: pointer;
		user-select: none;
	}
	/**/
	#nextPopup {
		display: none;
		position: fixed;
		z-index: 9999;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		padding: 18px 35px;
		background: #ffb3c1;
		border-radius: 12px;
		font-size: 24px;
		cursor: pointer;
	}

	#nextPopup.show {
		display: block;
	}
	
	
    /*грамматика*/
	.rules-lesson {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        padding: 16px;
        box-sizing: border-box;

        line-height: 1.5;
    }
	
    .rules-section {
        margin-bottom: 28px;
    }

    .rules-title {
        margin: 0 0 14px 0;
        font-size: 1.4rem;
    }

    .rules-subtitle {
        margin: 20px 0 10px 0;
        font-size: 1.1rem;
    }

    .rules-table,
    .conjugation-table {
        width: 100%;
        border-collapse: collapse;
        margin: 12px 0;
    }

    .rules-table th,
    .rules-table td,
    .conjugation-table th,
    .conjugation-table td {
        padding: 8px 10px;
        border: 1px solid currentColor;
        text-align: left;
    }

    .rules-notes {
        margin-top: 10px;
        font-size: 0.9rem;
    }

    .rules-note {
        margin: 4px 0;
    }

    .rules-text {
        margin: 10px 0;
    }

    .rules-example {
        margin: 10px 0;
    }

    .rules-example-fr {
        font-weight: bold;
    }
	.rules-audio {
		margin-left: 6px;
		cursor: pointer;
		user-select: none;
	}
