/* version v21 */
/* roboto-regular - latin */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/roboto-v20-latin-regular.eot'); /* IE9 Compat Modes */
  src: local('Roboto'), local('Roboto-Regular'),
  url('fonts/roboto-v20-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('fonts/roboto-v20-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ url('fonts/roboto-v20-latin-regular.woff') format('woff'), /* Modern Browsers */ url('fonts/roboto-v20-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ url('fonts/roboto-v20-latin-regular.svg#Roboto') format('svg'); /* Legacy iOS */
}

* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  min-height: 600px;
  font-size: 16px;
}

body {
  min-height: 100%;
  min-width: 336px;
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.6em;
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: fixed;
  overscroll-behavior: none;
  user-select: none;
}

h1 {
  flex: 1;
  font-weight: normal;
  margin: auto 0.75em;
  font-size: 1.25em;
  padding: 8px 8px 8px 2.25rem;
  text-align: left;
}

.header {
  display: flex;
  align-content: space-between;
  height: 2.75rem;
}

.toggle_orig {
  display: flex;
  align-self: end;
  height: 100%;
  box-sizing: border-box;
  padding: 0.2rem;
  margin-right: 0.3rem;
}

.toggle_wrapper {
  display: flex;
  flex-direction: row;
  padding: 0.5rem 0.5rem 1rem 0.5rem;
}

.toggle {
  display: flex;
  flex-grow: 1;
  height: 26px;
  box-sizing: border-box;
  padding: 0.2rem;
  margin-right: 0.3rem;
}

.toggle button {
  align-self: center;
  text-align: center;
  padding: 0.2rem 0.3rem;
  width: 100%;
  background-color: #333;
  border-radius: 0.4rem;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.toggle button.active {
  align-self: center;
  text-align: center;
  padding: 0.2rem 0.3rem;
  width: 100%;
  border-radius: 0.4rem;
  text-decoration: none;
}

main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  overflow-y: hidden;
  overscroll-behavior: none;
}

/**** Range slider ****/
.slider {
  -webkit-appearance: none;
  flex: 2 auto;
  height: 0.6rem;
  border-radius: 0.3rem;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  border-width: 0.16rem;
  border-style: solid;
  border-color: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 1.4rem;
  height: 1.4rem;
  border-width: 0.16rem;
  border-style: solid;
  border-color: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.slider:hover, .slider:active {
  opacity: 1;
  -webkit-transition: .2s;
  transition: opacity .2s;
}

.slidercontainer {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-flow: row nowrap;
  justify-content: space-between;
}

.slider_label {
  min-width: 4rem;
  padding-right: 16px;
  padding-left: 16px;
}

#chars_count, #speed_count {
  min-width: 2rem;
  padding-left: 16px;
  padding-right: 16px;
}

.settings_row {
  padding: 12px 0;
  font-size: 1em;
  margin-bottom: 8px;
  align-content: center;
  width: 100%;
}

#speed_settings_layout, #char_count_settings_layout {
  font-size: 1.25em;
  max-width: 33rem;
  min-width: 10rem;
  align-self: center;
}

#top_panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#bottom_panel {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  width: 100%;
  padding-bottom: 8px;
  align-content: center;
}

#settings_layout_wrapper {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  width: 100%;
  padding-bottom: 8px;
  align-content: center;
}

#random_settings_layout, #custom_chars_layout {
  display: flex;
  flex-flow: row;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  flex-grow: 1;
  justify-content: center;
}

.check_box_wrapper {
  display: flex;
  flex-flow: row nowrap;
  flex: 0 0 auto;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.custom_check_box_wrapper {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  max-width: 32rem;
  gap: 0;
  flex-grow: 1;
  padding: 0 0.5rem;
  align-items: center;
}

#custom_input {
  display: flex;
  flex-grow: 1;
  min-width: 0;
  height: 2rem;
  font-size: 1.25em;
  margin-left: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

#progress_layout {
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* custom progress checkbox */
#progress_layout ul {
  display: flex;
  flex-direction: row;
}

#progress_layout ul li {
  display: flex;
  flex: 1 1 auto;
  list-style-type: none;
  border-radius: 5px;
  background-image: url("img/cb_sprite.png");
  margin: 5px;
  width: 20px;
  height: 20px;
}

/* progress checks */
.cb_default {
  background-position: 0 0;
}

.cb_current {
  background-position: -60px 0;
}

.cb_correct {
  background-position: -40px 0;
}

.cb_wrong {
  background-position: -20px 0;
}

/* Task display text color */
.td_default {
  color: #000000;
}

.td_correct {
  color: #548100;
}

.td_wrong {
  color: #aa0000;
}

#task_display_box {
  display: flex;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 30rem;
  height: 3.5rem;
  background-image: url("img/red_line.png");
  background-size: 10px 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 5px;
  margin: 0.5rem 1rem 0 1rem;
}

#task_display {
  font-size: 2em;
  text-align: center;
  vertical-align: center;
}

#check_answer_layout {
  display: block;
  width: 100%;
  margin-top: 16px;
  visibility: hidden;
}

#answer_input {
  box-sizing: border-box;
  width: 100%;
  max-width: 30rem;
  height: 2.5rem;
  font-size: 2em;
  text-align: center;
  vertical-align: middle;
  padding: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  text-decoration: none;
  margin: 0.5rem 1rem 0.5rem 1rem;
}

#answer_input:focus {
  outline: none !important;
}

.full_width {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#check_button {
  width: 220px;
  margin: 2px;
  padding: 8px 2px;
  border-radius: 5px 5px;
  font-size: 1.5em;
}

#start_task_layout, #progress_layout, #question_layout {
  display: flex;
  width: 100%;
  justify-content: center;
}

#start_task {
  width: 200px;
  margin: 8px 16px;
  padding: 16px 16px;
  border-radius: 5px 5px;
  font-size: 1.5em;
}

#contact {
  flex-grow: 1;
  margin: 0.5rem;
  padding: 0.5rem;
  font-size: 1em;
  background-color: #333;
  color: white;
  border-radius: 0.4rem;
  outline: none;
  border: 1px solid black;
  cursor: pointer;
}

#contact:active {
  background-color: white;
  color: #333;
}


#start_task:focus, #check_button:focus, #contact:focus {
  outline: none;
}

#start_task, #check_button {
  cursor: pointer;
}

#start_task:disabled, #check_button:disabled {
  cursor: default;
}

input[type='checkbox'] {
  filter: grayscale(1);
  z-index: 1;
}

input[type='checkbox']:focus {
  outline: none;
}


.menu_open .menu_btn > span {
  transform: rotate(45deg);
}

.menu_open .menu_btn > span::before {
  top: 0;
  transform: rotate(0deg);
}

.menu_open .menu_btn > span::after {
  top: 0;
  transform: rotate(90deg);
}

.menu_box.open {
  left: 0 !important;
}

.menu_btn {
  position: fixed;
  top: 0.5rem;
  left: 0.625rem;
  width: 1.625rem;
  height: 1.625rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.menu_btn > span,
.menu_btn > span::before,
.menu_btn > span::after {
  display: block;
  position: absolute;
  width: 100%;
  height: 2px;
  transition-duration: .25s;
}

.menu_btn > span {
  top: calc(50% - 1px);
}

.menu_btn > span::before {
  content: '';
  top: -0.5rem;
}

.menu_btn > span::after {
  content: '';
  top: 0.5rem;
}

.menu_box {
  display: block;
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 25rem;
  height: 100%;
  margin: 0;
  padding: 3rem 0.5rem;
  list-style: none;
  transition-duration: .25s;
  z-index:2;
  overflow: hidden;
}

.menu_wrapper {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.menu_settings_wrapper {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  flex-grow: 1;
  margin: 0;
  padding: 0;
}

.menu_contact_wrapper {
  /* display: flex; */
  display:none;
  flex-direction: row;
  box-sizing: border-box;
  align-items: center;
  width: 100%;
  margin: 0 0 3rem 0;
  padding: 0;
}


#theme_layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.5rem;
  padding: 0 0.5rem;
}

#theme_colors_layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  column-gap: 0.5rem;
  padding: 0 0.5rem;
}

#font_size_layout {
  display: flex;
  flex-direction: row;
}

#fs_question_layout {
  display: flex;
  flex-grow: 4;
  justify-content: center;
  align-items: center;
}


#fs_task_display_box {
  display: flex;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 3.5rem;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 5px;
}

#fs_font_size_display {
  display: flex;
  width: 100%;
  font-size: 2em;
  text-align: center;
  justify-content: center;
}

.menu_button {
  display: flex;
  flex-grow: 1;
  margin: 8px 16px;
  border-radius: 5px 5px;
  font-size: 1.5em;
  height: 3.5rem;
  text-align: center;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.menu_box p {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  margin-left: 16px;
  font-size: 1.3em;
  font-variant: all-small-caps;
}

/* w3schools custom checkbox */
/* Customize the label (the container) */
.cb_container {
  display: block;
  position: relative;
  white-space: nowrap;
  padding-left: 1.7rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide the browser's default checkbox */
.cb_container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom checkbox */
.cb_container .checkmark {
  position: absolute;
  box-sizing: border-box;
  top: 0;
  left: 0;
  height: 1.4rem;
  width: 1.4rem;
  border-radius: 25%;
}

.custom_check_box_wrapper .checkmark {
  top: 0.125rem;
}

/* Create the checkmark/indicator (hidden when not checked) */
.cb_container .checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the checkmark when checked */
.cb_container input:checked ~ .checkmark:after {
  display: block;
}

/* Style the checkmark/indicator */
.cb_container .checkmark:after {
  left: 0.44rem;
  top: 0.2rem;
  width: 0.22rem;
  height: 0.545rem;
  border: solid white;
  border-width: 0 0.2rem 0.2rem 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

/* custom radio buttons - color selectors */
/* Customize the label (the container) */
.rbc_container {
  display: block;
  position: relative;
  box-sizing: border-box;
  padding-left: 1.83rem;
  padding-bottom: 0.45rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  border-radius: 0.5rem;
  border: solid 1px #fff;
}

/* Hide the browser's default radio button */
.rbc_container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom radio button */
.rbc_container .checkmark {
  position: absolute;
  box-sizing: border-box;
  border-width: 0.16rem;
  border-style: solid;
  border-color: #fff;
  background-color: #fff;
  top: 0.2rem;
  left: 0.2rem;
  height: 1.66rem;
  width: 1.66rem;
  border-radius: 50%;
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.rbc_container .checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the indicator (dot/circle) when checked */
.rbc_container input:checked ~ .checkmark:after {
  display: block;
}

/* Style the indicator (dot/circle) */
.rbc_container .checkmark:after {
  top: 0.43rem;
  left: 0.43rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: white;
}

.light {
  background-color: #f1f1f1;
  border-color: #000;
}

.dark {
  background-color: #222;
  border-color: #fff;
}

.orange {
  background-image: linear-gradient(90deg, #FF6800, #FF8000, #FF9700);
}

.olive {
  background-image: linear-gradient(90deg, #828c00, #8d9801, #9fab02);
}

.blue {
  background-image: linear-gradient(90deg, #00628c, #017598, #027eab);
}

.purple {
  background-image: linear-gradient(90deg, #54006e, #5b007a, #650081);
}

.black {
  background-image: linear-gradient(90deg, #000000, #090909, #0f0f0f);
}

/* THEMES */
/* ORANGE */
.th_orange #start_task, .th_orange #check_button {
  background-image: linear-gradient(90deg, #FF6800, #FF8000, #FF9700);
  border: solid 1px #ee5f00;
  color: #ffffff;
}

.th_orange #start_task:active, .th_orange #check_button:active {
  background-image: linear-gradient(170deg, #FF6800, #FF8000, #FF9700);
}

.th_orange #start_task:disabled, .th_orange #check_button:disabled {
  border: solid 1px #ff8633;
  opacity: 50%;
}

.th_orange .slider {
  background: #ffb88a;
}

.th_orange .slider::-webkit-slider-thumb {
  background: #ff6b05;
}

.th_orange .slider::-moz-range-thumb {
  background: #ff6b05;
}

.th_orange #answer_input {
  border-bottom: solid 2px #aaaaaa;
  caret-color: #ee5f00;
}

.th_orange #answer_input:focus {
  border-bottom: solid 2px #ee5f00;
}

.th_orange .cb_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #FF6800, #FF8000, #FF9700);
  border: solid 1px #FF6800;
}

.th_orange .rbc_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #FF6800, #FF8000, #FF9700);
}

/* OLIVE */
.th_olive #start_task, .th_olive #check_button {
  background-image: linear-gradient(90deg, #828c00, #8d9801, #9fab02);
  border: solid 1px #828c00;
  color: #ffffff;
}

.th_olive #start_task:active, .th_olive #check_button:active {
  background-image: linear-gradient(170deg, #828c00, #8d9801, #9fab02);
}

.th_olive #start_task:disabled, .th_olive #check_button:disabled {
  border: solid 1px #f1ff33;
  opacity: 50%;
}

.th_olive .slider {
  background: #8ba12f;
}

.th_olive .slider::-webkit-slider-thumb {
  background: #79810a;
}

.th_olive .slider::-moz-range-thumb {
  background: #79810a;
}

.th_olive #answer_input {
  border-bottom: solid 2px #aaaaaa;
  caret-color: #828c00;
}

.th_olive #answer_input:focus {
  border-bottom: solid 2px #828c00;
}

.th_olive .cb_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #828c00, #8d9801, #9fab02);
  border: solid 1px #828c00;
}

.th_olive .rbc_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #828c00, #8d9801, #9fab02);
}

/* BLUE */
.th_blue #start_task, .th_blue #check_button {
  background-image: linear-gradient(90deg, #00628c, #017598, #027eab);
  border: solid 1px #006b8c;
  color: #ffffff;
}

.th_blue #start_task:active, .th_blue #check_button:active {
  background-image: linear-gradient(170deg, #00628c, #017598, #027eab);
}

.th_blue #start_task:disabled, .th_blue #check_button:disabled {
  border: solid 1px #33cfff;
  opacity: 50%;
}

.th_blue .slider {
  background: #2d91b6;
}

.th_blue .slider::-webkit-slider-thumb {
  background: #02688a;
}

.th_blue .slider::-moz-range-thumb {
  background: #02688a;
}

.th_blue #answer_input {
  border-bottom: solid 2px #aaaaaa;
  caret-color: #00568c;
}

.th_blue #answer_input:focus {
  border-bottom: solid 2px #00678c;
}

.th_blue .cb_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #00628c, #017598, #027eab);
  border: solid 1px #005b8c;
}

.th_blue .rbc_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #00628c, #017598, #027eab);
}

/* PURPLE */
.th_purple #start_task, .th_purple #check_button {
  background-image: linear-gradient(90deg, #54006e, #5b007a, #650081);
  border: solid 1px #47075b;
  color: #ffffff;
}

.th_purple #start_task:active, .th_purple #check_button:active {
  background-image: linear-gradient(170deg, #54006e, #5b007a, #650081);
}

.th_purple #start_task:disabled, .th_purple #check_button:disabled {
  border: solid 1px #5b1970;
  opacity: 50%;
}

.th_purple .slider {
  background: #7e3793;
}

.th_purple .slider::-webkit-slider-thumb {
  background: #54006e;
}

.th_purple .slider::-moz-range-thumb {
  background: #54006e;
}

.th_purple #answer_input {
  border-bottom: solid 2px #aaaaaa;
  caret-color: #54006e;
}

.th_purple #answer_input:focus {
  border-bottom: solid 2px #54006e;
}

.th_purple .cb_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #54006e, #5b007a, #650081);
  border: solid 1px #47075b;
}

.th_purple .rbc_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #54006e, #5b007a, #650081);
}

/* BLACK */
.th_black #start_task, .th_black #check_button {
  background-image: linear-gradient(90deg, #000000, #090909, #0f0f0f);
  border: solid 1px #333333;
  color: #ffffff;
}

.th_black #start_task:active, .th_black #check_button:active {
  background-image: linear-gradient(170deg, #111111, #191919, #1f1f1f);
}

.th_black #start_task:disabled, .th_black #check_button:disabled {
  border: solid 1px #333333;
  color: #595959;
  opacity: 50%;
}

.th_black .slider {
  background: #757575;
}

.th_black .slider::-webkit-slider-thumb {
  background: #000000;
}

.th_black .slider::-moz-range-thumb {
  background: #000000;
}

.th_black #answer_input {
  border-bottom: solid 2px #aaaaaa;
}

.th_black #answer_input:focus {
  border-bottom: solid 2px #1c1c1c;
}

.er.th_black #answer_input:focus {
  border-bottom: solid 2px #fff;
}

.th_black .cb_container input:checked ~ .checkmark {
  /*background-color: #FF6800; */
  background-image: linear-gradient(90deg, #000000, #090909, #0f0f0f);
  border: solid 1px #333333;
}

.th_black .rbc_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, #000000, #090909, #0f0f0f);
}

/* LIGHT THEMES */
body.light  {
  background: #fafafa;
  color: #333;
}

.light h1 {
  color: #ffffff;
}

.light .header {
  background-color: #222;
  border-bottom: 1px solid #fff;
}

.light .toggle button {
  color: white;
  border: 1px solid #8a8a8a;
}

.light .toggle button:hover {
  background-color: #000;
}

.light .toggle button.active {
  background-color: #fff;
  color: #222;
  border: 1px solid #222;
}

.light main {
  background-color: #f1f1f1;
}

.light #task_display_box {
  background-color: #fff;
  background-image: url("img/red_line.png");
  border: solid 1px #aeaeae;
}

.light .menu_open .menu_btn > span {
  background-color: #151515;
}
.light .menu_open .menu_btn > span::before {
  background-color: #151515;
}
.light .menu_open .menu_btn > span::after {
  background-color: #151515;
}

.light .menu_btn > span,
.light .menu_btn > span::before,
.light .menu_btn > span::after {
  background-color: #eeeeee;
}

.light .menu_box {
  background-image: linear-gradient(180deg, rgba(240, 240, 240, 1), rgba(240, 240, 240, 0.9), rgba(255, 255, 255, 0.7));
  box-shadow: 2px 2px 6px rgba(0, 0, 0, .4);
}

.light #fs_task_display_box {
  background-color: #fff;
  border: solid 1px #aeaeae;
}

.light .menu_button {
  border: solid 1px #aaa;
  color: #000;
}

.light .menu_button:active {
  background-color: #fff;
  border-color: #555;
}

.light .cb_container .checkmark {
  background-color: #fff;
  border: solid 1px #8c8c8c;
}

.light .cb_container input:disabled ~ .checkmark {
  background-color: #eee;
  border: solid 1px #8c8c8c;
}

.light #custom_input, .dark #custom_input {
  background-color: #fff;
  border: solid 1px #999;
  color: #000;
}

.light #answer_input, .dark #answer_input {
  background-color: #f1f1f1;
  color: #000;
  caret-color: #000000;
}

/* DARK THEME */
body.dark  {
  background: #000;
  color: #ccc;
}

.dark h1 {
  color: #ffffff;
}

.dark .header {
  background-color: #000;
  border-bottom: 1px solid #d3d3d3;
}

.dark .toggle button {
  color: white;
  border: 1px solid #8a8a8a;
}

.dark .toggle button:hover {
  background-color: #000;
}

.dark .toggle button.active {
  background-color: #fff;
  color: #222;
  border: 1px solid #222;
}

.dark main {
  background-color: #111;
}

.dark #task_display_box {
  background-color: #fff;
  background-image: url("img/red_line.png");
  border: solid 1px #aeaeae;
}

.dark .menu_open .menu_btn > span {
  background-color: #eeeeee;
}
.dark .menu_open .menu_btn > span::before {
  background-color: #eeeeee;
}
.dark .menu_open .menu_btn > span::after {
  background-color: #eeeeee;
}

.dark .menu_btn > span,
.dark .menu_btn > span::before,
.dark .menu_btn > span::after {
  background-color: #eeeeee;
}

.dark .menu_box {
  background-image: linear-gradient(180deg, rgba(20, 20, 20, 1), rgba(20, 20, 20, 0.9), rgba(0, 0, 0, 0.7));
  box-shadow: 2px 2px 6px rgba(0, 0, 0, .4);
}

.dark #fs_task_display_box {
  background-color: #fff;
  border: solid 1px #aeaeae;
}

.dark .menu_button {
  border: solid 1px #aaa;
  color: #000;
}

.dark .menu_button:active {
  background-color: #fff;
  border-color: #555;
}
.dark .cb_container .checkmark {
  background-color: #fff;
  border: solid 1px #8c8c8c;
}

.dark .cb_container input:disabled ~ .checkmark {
  background-color: #252525;
  border: solid 1px #737373;
}

/* DARK-ER THEME */
.er #fs_task_display_box, .er #task_display_box {
  background-color: #000;
  border: solid 1px #333;
}

.er #task_display_box {
  background-image: url("img/red_line_dark.png");
}

.er .td_default {
  color: #fff;
}

.er.rbc_container .checkmark {
   background-color: #000;
}

.nes.rbc_container .checkmark {
  border-color: #333;
}

.er .cb_container .checkmark {
  background-color: #000;
  border: solid 1px #444;
}

.er .menu_button {
  filter: invert(100%);
}

.er .menu_button:active {
  filter: invert(90%);
}

.er #custom_input {
  background-color: #000;
  border: solid 1px #555;
  color: #fff;
}

.er #answer_input {
  background-color: #000;
  color: #f0f0f0;
  caret-color: #fff;
}

.er .slider::-webkit-slider-thumb {
  border-color: #ccc;
}

.er .slider::-moz-range-thumb {
  border-color: #ccc;
}

.er .td_correct {
  color: #88a650;
}

.er .td_wrong {
  color: #bb6161;
}

.visually_hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
input:focus-visible,
.menu_btn:focus-visible {
  outline: 3px solid currentColor !important;
  outline-offset: 3px;
}

.cb_container input:focus-visible ~ .checkmark,
.rbc_container input:focus-visible ~ .checkmark {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Session and records interface */
[hidden] {
  display: none !important;
}

.th_orange {
  --accent: #ff6800;
  --accent-mid: #ff8000;
  --accent-end: #ff9700;
}

.th_olive {
  --accent: #828c00;
  --accent-mid: #8d9801;
  --accent-end: #9fab02;
}

.th_blue {
  --accent: #00628c;
  --accent-mid: #017598;
  --accent-end: #027eab;
}

.th_purple {
  --accent: #54006e;
  --accent-mid: #5b007a;
  --accent-end: #650081;
}

.th_black {
  --accent: #111;
  --accent-mid: #191919;
  --accent-end: #2a2a2a;
}

.app_view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

#training_view {
  justify-content: space-between;
}

#setup_panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

#bottom_panel {
  overflow-y: auto;
  scrollbar-width: thin;
}

.setup_group {
  border: 0;
  margin: 0;
  padding: 0.15rem 0.75rem;
}

.setup_group legend {
  font-size: 0.82rem;
  font-variant: all-small-caps;
  letter-spacing: 0.04em;
  /* margin-left: 0.25rem; */
  margin: 0.25rem auto;
}

.choice_row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.choice_row button,
.view_actions button,
.data_actions button,
.dialog_actions button,
.menu_navigation_button,
#session_control_button {
  background: #333;
  border: 1px solid #777;
  border-radius: 0.4rem;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 0.45rem 0.7rem;
}

.choice_row button[aria-pressed="true"],
.menu_navigation_button,
.view_actions button:first-child,
#session_control_button {
  background-image: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  border-color: var(--accent);
}

.choice_row button:disabled,
.view_actions button:disabled,
.data_actions button:disabled {
  cursor: default;
  opacity: 0.5;
}

.setup_hint {
  font-size: 0.82rem;
  min-height: 1.3em;
  text-align: center;
}

.adaptive_row {
  display: flex;
  justify-content: center;
  padding: 0.15rem;
}

.adaptive_row label {
  cursor: pointer;
}

.daily_summary {
  margin: 0.75rem auto;
  max-width: 34rem;
  padding: 1rem;
  text-align: center;
}

.daily_summary h2 {
  font-size: 1.25rem;
  font-weight: normal;
  margin-bottom: 0.4rem;
}

.session_status {
  font-size: 0.9rem;
  min-height: 1.6rem;
  padding: 0.4rem 0.75rem 0;
  text-align: center;
}

#progress_layout ul:empty {
  display: none;
}

#progress_layout ul {
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
}

.answer_prompt {
  font-weight: 600;
  margin: 0.25rem 1rem;
  text-align: center;
}

.review_details {
  margin: 0.25rem auto 0.75rem;
  max-width: 30rem;
  padding: 0 1rem;
  text-align: left;
}

.review_details p {
  overflow-wrap: anywhere;
}

#session_control_layout {
  display: flex;
  justify-content: center;
}

#session_control_button {
  font-size: 1.05rem;
  margin: 0.75rem;
  min-width: 13rem;
}

.content_view {
  box-sizing: border-box;
  gap: 1rem;
  overflow-y: auto;
  padding: 1.25rem clamp(1rem, 5vw, 3rem) 2rem;
}

.content_view > h2 {
  font-size: 1.6rem;
  font-weight: normal;
}

.content_view h3 {
  font-size: 1.1rem;
  font-weight: normal;
  margin-bottom: 0.35rem;
}

.primary_result {
  font-size: 1.4rem;
}

.positive_message {
  color: #548100;
  font-weight: 600;
}

.dark .positive_message {
  color: #a9cf61;
}

.warning_message {
  border-left: 4px solid #b76b00;
  padding: 0.65rem;
}

.view_actions,
.data_actions,
.dialog_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.danger_button {
  background: #8b1a1a !important;
}

.privacy_statement {
  font-size: 1.1rem;
  font-weight: 600;
}

.record_list,
.recent_list {
  display: grid;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}

.record_list li,
.recent_list li {
  border-bottom: 1px solid rgba(128, 128, 128, 0.35);
  padding: 0.35rem 0;
}

dialog {
  background: #f5f5f5;
  border: 1px solid #777;
  border-radius: 0.5rem;
  color: #222;
  margin: auto;
  max-height: 80vh;
  max-width: min(34rem, calc(100% - 2rem));
  overflow-y: auto;
  padding: 1.25rem;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

dialog h2 {
  font-size: 1.35rem;
  font-weight: normal;
  margin-bottom: 0.75rem;
}

dialog .dialog_actions {
  justify-content: flex-end;
}

.menu_navigation_button {
  margin: 0.75rem;
}

#manual_settings {
  display: flex;flex-direction: column;
}

@media (max-height: 720px) {
  #question_layout {
    min-height: 4rem;
  }

  .settings_row {
    margin-bottom: 0;
    padding: 0.35rem 0;
  }

  #task_display_box {
    margin-top: 0.25rem;
  }
}

/* Polished records and results views */
.light {
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-quiet: #ececec;
  --text-strong: #242424;
  --text-muted: #656565;
  --border-soft: #d6d6d6;
  --shadow-soft: 0 0.35rem 1.1rem rgba(0, 0, 0, 0.07);
}

.dark {
  --surface: #1a1a1a;
  --surface-soft: #141414;
  --surface-quiet: #292929;
  --text-strong: #f1f1f1;
  --text-muted: #b7b7b7;
  --border-soft: #3d3d3d;
  --shadow-soft: 0 0.35rem 1.1rem rgba(0, 0, 0, 0.32);
}

.dark.er {
  --surface: #080808;
  --surface-soft: #030303;
  --surface-quiet: #171717;
  --border-soft: #303030;
}

.records_view,
#results_view {
  margin-inline: auto;
  max-width: 72rem;
  width: 100%;
}

.records_view {
  gap: 1.35rem;
}

.records_header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.records_header h2,
#results_view > h2 {
  color: var(--text-strong);
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  line-height: 1.1;
  margin: 0;
}

.section_kicker {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  margin: 0 0 0.3rem;
  text-transform: uppercase;
}

.local_storage_badge {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.8rem;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
}

.local_storage_badge::before {
  background: var(--accent);
  border-radius: 50%;
  content: "";
  height: 0.5rem;
  width: 0.5rem;
}

.records_intro {
  color: var(--text-muted);
  line-height: 1.55;
  margin: -0.65rem 0 0;
  max-width: 64ch;
}

.records_section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  box-shadow: var(--shadow-soft);
  padding: clamp(1rem, 3vw, 1.45rem);
}

.section_heading {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.records_section .section_heading h3 {
  color: var(--text-strong);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.section_summary {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin: 0 0 0.05rem;
  text-align: right;
}

.metric_grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric_card {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  min-height: 7.7rem;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.metric_card::before,
.personal_best_card::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  content: "";
  height: 0.22rem;
  inset: 0 0 auto;
  position: absolute;
}

.metric_value {
  color: var(--text-strong);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 0.75rem;
}

.metric_card h4 {
  color: var(--text-strong);
  font-size: 0.92rem;
  margin: 0 0 0.15rem;
}

.metric_detail {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0;
}

.practice_week {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 0.75rem;
  padding: 0.75rem;
}

.practice_day {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  gap: 0.35rem;
  min-width: 0;
  text-align: center;
}

.practice_weekday {
  font-weight: 700;
  text-transform: uppercase;
}

.practice_day_marker {
  background: var(--surface-quiet);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  height: 1.15rem;
  width: 1.15rem;
}

.practice_day.is_active .practice_day_marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.22rem var(--surface);
}

.practice_day.is_active {
  color: var(--text-strong);
}

.practice_date {
  font-variant-numeric: tabular-nums;
}

.personal_bests_grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.personal_best_card {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.personal_best_header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.personal_best_header time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.record_type_badge,
.activity_badge,
.result_context_chips span {
  background: var(--surface-quiet);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.36rem 0.55rem;
}

.personal_best_value_row {
  align-items: baseline;
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 0.8rem;
}

.personal_best_value_row strong {
  color: var(--text-strong);
  font-size: 2.3rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.personal_best_value_row span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.record_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.record_tags li {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.28rem 0.42rem;
}

.recent_session_list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent_session_item {
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.recent_session_item:first-child {
  padding-top: 0.15rem;
}

.recent_session_item:last-child {
  border-bottom: 0;
  padding-bottom: 0.15rem;
}

.recent_session_summary {
  min-width: 0;
}

.recent_session_title_row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recent_session_title_row strong {
  color: var(--text-strong);
  font-size: 0.95rem;
}

.recent_session_metadata {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.3rem 0 0;
}

.recent_session_score {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
}

.recent_session_score strong {
  color: var(--text-strong);
  font-size: 1.35rem;
  line-height: 1;
}

.recent_session_score span {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.data_panel {
  background: var(--surface-soft);
  box-shadow: none;
}

.data_panel > p {
  line-height: 1.5;
  margin: 0.35rem 0;
}

.data_note {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.data_panel .data_actions {
  align-items: center;
}

.data_panel .danger_button {
  margin-left: auto;
}

.empty_state {
  background: var(--surface-soft);
  border: 1px dashed var(--border-soft);
  border-radius: 0.7rem;
  color: var(--text-muted);
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.records_footer_actions {
  margin-top: 0;
}

/* Results use the same visual language as records. */
#results_view {
  justify-content: flex-start;
}

#results_view .primary_result {
  color: var(--text-strong);
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0.15rem 0 0.5rem;
}

#results_statistics {
  display: grid;
  gap: 0.8rem;
}

.result_context_chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.result_metric_grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result_metric {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 5rem;
  padding: 0.85rem;
}

.result_metric strong {
  color: var(--text-strong);
  font-size: 1.7rem;
  line-height: 1;
}

.result_metric span {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.3;
  margin-top: 0.5rem;
}

#results_view .positive_message:not(:empty) {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 0.3rem solid var(--accent);
  border-radius: 0.55rem;
  padding: 0.8rem 1rem;
}

.choice_row button,
.view_actions button,
.data_actions button,
.dialog_actions button,
.menu_navigation_button,
#session_control_button {
  transition: filter 140ms ease, transform 140ms ease;
}

.choice_row button:not(:disabled):hover,
.view_actions button:not(:disabled):hover,
.data_actions button:not(:disabled):hover,
.dialog_actions button:not(:disabled):hover,
.menu_navigation_button:not(:disabled):hover,
#session_control_button:not(:disabled):hover {
  filter: brightness(1.12);
}

.choice_row button:not(:disabled):active,
.view_actions button:not(:disabled):active,
.data_actions button:not(:disabled):active,
.dialog_actions button:not(:disabled):active,
.menu_navigation_button:not(:disabled):active,
#session_control_button:not(:disabled):active {
  transform: translateY(1px);
}

@media (max-width: 760px) {
  .content_view {
    padding-inline: 1rem;
  }

  .records_header {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric_grid,
  .personal_bests_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section_heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .section_summary {
    text-align: left;
  }

  .result_metric_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data_panel .danger_button {
    margin-left: 0;
  }
}
  
@media (max-width: 545px) {
  .personal_bests_grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .records_view {
    gap: 1rem;
  }

  .records_section {
    border-radius: 0.75rem;
    padding: 0.85rem;
  }

  .metric_card {
    min-height: 7rem;
    padding: 0.85rem;
  }

  .metric_value {
    font-size: 2rem;
  }

  .practice_week {
    gap: 0.1rem;
    padding-inline: 0.45rem;
  }

  .practice_weekday,
  .practice_date {
    font-size: 0.65rem;
  }

  .practice_day_marker {
    height: 0.95rem;
    width: 0.95rem;
  }

  .recent_session_item {
    align-items: flex-start;
  }

  .recent_session_score strong {
    font-size: 1.15rem;
  }

  .data_actions,
  .view_actions {
    align-items: stretch;
    flex-direction: column;
  }

  .data_actions button,
  .view_actions button {
    width: 100%;
  }
}

/* Contextual header navigation and polished activity screen */
.menu_btn > span,
.menu_btn > span::before,
.menu_btn > span::after {
  transition: background-color 180ms ease, top 250ms ease,
    transform 250ms ease, width 250ms ease;
}

.records_mode .menu_btn > span {
  transform: translateX(0.08rem);
  width: 1.35rem;
}

.records_mode .menu_btn > span::before,
.records_mode .menu_btn > span::after {
  left: 0;
  top: 0;
  transform-origin: left center;
  width: 0.78rem;
}

.records_mode .menu_btn > span::before {
  transform: rotate(-42deg);
}

.records_mode .menu_btn > span::after {
  transform: rotate(42deg);
}

.records_mode .menu_btn:hover > span {
  transform: translateX(0);
}

.light {
  --display-surface: #ffffff;
  --display-text: #171717;
  --correct-soft: #edf5df;
  --wrong-soft: #fae6e6;
}

.dark {
  --display-surface: #f6f6f6;
  --display-text: #171717;
  --correct-soft: #1d2c14;
  --wrong-soft: #351a1a;
}

.dark.er {
  --display-surface: #050505;
  --display-text: #f1f1f1;
}

#training_view {
  box-sizing: border-box;
  gap: clamp(0.8rem, 2vw, 1.2rem);
  justify-content: flex-start;
  overflow-y: auto;
  padding: clamp(0.8rem, 2vw, 1.4rem) clamp(0.8rem, 4vw, 2.5rem) 2rem;
  scrollbar-width: thin;
}

#top_panel,
#bottom_panel {
  margin-inline: auto;
  max-width: 72rem;
  width: 100%;
}

#top_panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.95rem;
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
  overflow: hidden;
  padding: clamp(0.95rem, 2.5vw, 1.4rem);
  position: relative;
}

#top_panel::before,
#setup_panel::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  content: "";
  height: 0.24rem;
  inset: 0 0 auto;
  position: absolute;
}

.stage_heading,
.setup_heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.stage_heading h2,
.setup_heading h2 {
  color: var(--text-strong);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

.stage_detail,
.setup_heading > p {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0.1rem 0 0;
  max-width: 35rem;
  text-align: right;
}

.session_status:not(:empty) {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
  margin: 0.85rem auto 0;
  min-height: 0;
  padding: 0.38rem 0.75rem;
  width: fit-content;
}

#question_layout {
  min-height: clamp(5rem, 13vw, 7.3rem);
}

#task_display_box {
  background-color: var(--display-surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.85rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 0.3rem 0.8rem rgba(0, 0, 0, 0.06);
  height: clamp(4.8rem, 12vw, 6.5rem);
  margin: 0.65rem auto 0;
  max-width: 40rem;
  overflow: hidden;
}

#task_display {
  color: var(--display-text);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1;
}

.er #task_display {
  color: var(--display-text);
}

#progress_layout {
  margin-top: 0.5rem;
}

#progress_layout ul li {
  background-image: none;
  background-position: initial;
  border: 2px solid var(--border-soft);
  border-radius: 50%;
  box-sizing: border-box;
  height: 0.9rem;
  margin: 0.25rem;
  position: relative;
  transition: background-color 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease, transform 180ms ease;
  width: 0.9rem;
}

#progress_layout ul li.cb_current {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent) 18%, transparent);
  transform: scale(1.08);
}

#progress_layout ul li.cb_correct {
  background: #628f18;
  border-color: #628f18;
}

#progress_layout ul li.cb_wrong {
  background: #b53a3a;
  border-color: #b53a3a;
}

.answer_prompt {
  color: var(--text-strong);
  margin-top: 0.2rem;
}

#check_answer_layout {
  margin: 0.45rem auto 0;
  max-width: 40rem;
}

#training_view #answer_input {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.7rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--text-strong);
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  height: 3.45rem;
  margin: 0.4rem 0;
  padding: 0.25rem 0.75rem;
  transition: border-color 160ms ease, box-shadow 160ms ease,
    background-color 160ms ease;
}

#training_view #answer_input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}

#training_view #answer_input:disabled {
  opacity: 0.72;
}

#training_view #check_button,
#training_view #start_task {
  border-radius: 0.55rem;
  box-shadow: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.12);
  font-weight: 600;
  letter-spacing: 0.025em;
  min-height: 2.9rem;
  transition: filter 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

#training_view #check_button {
  margin-top: 0.35rem;
  max-width: 16rem;
  width: 100%;
}

#training_view #start_task {
  margin: 0.65rem 0 0;
  max-width: 20rem;
  width: min(100%, 20rem);
}

#training_view #check_button:not(:disabled):hover,
#training_view #start_task:not(:disabled):hover {
  filter: brightness(1.08);
  box-shadow: 0 0.35rem 0.8rem rgba(0, 0, 0, 0.16);
}

#training_view #check_button:not(:disabled):active,
#training_view #start_task:not(:disabled):active {
  box-shadow: 0 0.15rem 0.35rem rgba(0, 0, 0, 0.13);
  transform: translateY(1px);
}

.review_details {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.7rem;
  box-sizing: border-box;
  color: var(--text-muted);
  margin: 0.5rem auto 0.75rem;
  padding: 0.75rem 0.9rem;
}

.review_details strong {
  color: var(--text-strong);
}

#bottom_panel {
  flex: 0 0 auto;
  overflow: visible;
  padding-bottom: 0;
}

#setup_panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.95rem;
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
  gap: 0.8rem;
  overflow: hidden;
  padding: clamp(0.95rem, 2.5vw, 1.35rem);
  position: relative;
}

.setup_heading {
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 0.05rem;
  padding-bottom: 0.9rem;
}

.setup_group {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem 0.85rem;
}

.setup_group legend {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-variant: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 0.25rem;
  padding: 0 0.3rem;
  text-transform: uppercase;
}

#ordinary_setup {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#adaptive_layout,
#manual_settings {
  grid-column: 1 / -1;
}

#training_view .choice_row {
  align-items: stretch;
}

#training_view .choice_row button {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text-strong);
  flex: 1 1 6rem;
  min-height: 2.55rem;
  padding: 0.48rem 0.75rem;
}

#training_view .choice_row button[aria-pressed="true"] {
  background-image: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  border-color: var(--accent);
  box-shadow: 0 0.18rem 0.4rem color-mix(in srgb, var(--accent) 22%, transparent);
  color: #ffffff;
}

.setup_hint {
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0.5rem 0 0;
  min-height: 0;
}

.adaptive_row {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  justify-content: flex-start;
  padding: 0.7rem 0.85rem;
}

.adaptive_row label {
  align-items: center;
  color: var(--text-strong);
  display: flex;
  gap: 0.55rem;
}

.adaptive_row input {
  accent-color: var(--accent);
  height: 1.05rem;
  width: 1.05rem;
}

#manual_settings {
  /* background: var(--surface-soft); */
  /* border: 1px solid var(--border-soft); */
  /* border-radius: 0.75rem; */
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  /* padding: 0.75rem; */
}

#char_count_settings_layout,
#speed_settings_layout {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.65rem;
  box-sizing: border-box;
  font-size: 1rem;
  margin: 0;
  max-width: none;
  min-width: 0;
  padding: 0.65rem;
}

.slidercontainer {
  gap: 0.7rem;
}

.slider_label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  min-width: auto;
  padding: 0;
  text-transform: uppercase;
}

#chars_count,
#speed_count {
  align-items: center;
  background: var(--surface-quiet);
  border: 1px solid var(--border-soft);
  border-radius: 0.4rem;
  color: var(--text-strong);
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.15rem 0.35rem;
}

#random_settings_layout,
#custom_chars_layout {
  grid-column: 1 / -1;
}

#random_settings_layout {
  padding-top: 0.4rem;
}

.check_box_wrapper {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.65rem;
  margin: 0.25rem;
  padding: 0.38rem 0.65rem;
  line-height: 1.4rem;
}

.custom_check_box_wrapper {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.65rem;
  box-sizing: border-box;
  margin: 0.1rem auto 0;
  max-width: 38rem;
  padding: 0.45rem 0.55rem;
}

#custom_input {
  border-radius: 0.4rem;
  box-sizing: border-box;
  height: 2.35rem;
}

.daily_summary {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  box-sizing: border-box;
  margin: 0;
  max-width: none;
}

.daily_summary h2 {
  color: var(--text-strong);
  font-weight: 600;
}

#start_task_layout {
  border-top: 1px solid var(--border-soft);
  margin-top: 0.05rem;
  padding-top: 0.25rem;
}

#session_control_layout {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.8rem;
  box-shadow: var(--shadow-soft);
  margin-inline: auto;
  max-width: 72rem;
  width: 100%;
}

#session_control_button {
  margin: 0.65rem;
}

@media (max-width: 760px) {
  #training_view {
    padding: 0.75rem 0.75rem 1.25rem;
  }

  .stage_heading,
  .setup_heading {
    flex-direction: column;
    gap: 0.3rem;
  }

  .stage_detail,
  .setup_heading > p {
    text-align: left;
  }

  #ordinary_setup,
  #manual_settings {
    grid-template-columns: 1fr;
  }

  #activity_setup_group,
  #presentation_setup_group,
  #char_count_settings_layout,
  #speed_settings_layout {
    grid-column: 1;
  }

  #task_display_box {
    height: 4.8rem;
  }

  #training_view .choice_row button {
    flex-basis: 5.5rem;
  }
}

@media (max-width: 430px) {
  #top_panel,
  #setup_panel {
    border-radius: 0.78rem;
    padding: 0.82rem;
  }

  .stage_heading h2,
  .setup_heading h2 {
    font-size: 1.25rem;
  }

  .stage_detail,
  .setup_heading > p {
    font-size: 0.78rem;
  }

  #question_layout {
    min-height: 4.7rem;
  }

  #task_display_box {
    height: 4.3rem;
    margin-top: 0.5rem;
  }

  #task_display {
    font-size: 2rem;
  }

  #training_view #answer_input {
    font-size: 1.7rem;
    height: 3.15rem;
  }

  .setup_group {
    padding: 0.55rem 0.65rem 0.7rem;
  }

  .check_box_wrapper {
    padding: 0.32rem 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu_btn > span,
  .menu_btn > span::before,
  .menu_btn > span::after,
  #progress_layout ul li,
  #training_view #answer_input,
  #training_view #check_button,
  #training_view #start_task {
    transition-duration: 0.01ms;
  }
}

#top_panel,
#bottom_panel {
  flex: 0 0 auto;
}

.adaptive_row input {
  filter: none;
}

#records_heading:focus,
#results_heading:focus {
  outline: none;
}

#records_heading:focus-visible,
#results_heading:focus-visible {
  border-radius: 0.2rem;
  outline: 2px solid var(--accent);
  outline-offset: 0.22rem;
}


/* v17: deterministic previews, compact training focus, aligned review feedback */
#training_view.session_active #question_layout {
  min-height: 4.25rem;
}

#training_view.session_active #task_display_box {
  height: 3.5rem;
  max-width: 30rem;
}

#training_view.session_active #task_display,
#training_view.session_active #answer_input {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 2em;
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1;
}

#training_view.session_active #answer_input {
  height: 3.5rem;
  max-width: 30rem;
}

.answer_character {
  display: inline-block;
  min-width: 0.55em;
}

.answer_character_correct {
  color: #548100;
}

.answer_character_wrong {
  color: #aa0000;
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.12em;
}

.no_underline {
  text-decoration: none;
}

.er .answer_character_correct {
  color: #9fbd68;
}

.er .answer_character_wrong {
  color: #ff7c7c;
}

@media (max-width: 430px) {
  #training_view.session_active #task_display_box,
  #training_view.session_active #answer_input {
    height: 3.5rem;
  }

  #training_view.session_active #task_display,
  #training_view.session_active #answer_input {
    font-size: 2em;
  }
}

/* v19: responsive settings, generated accents and answer-entry review */
:root {
  --accent: #b74200;
  --accent-mid: #d05200;
  --accent-end: #e86800;
  --accent-track: #e4b59a;
  --accent-border: #b74200;
  --accent-contrast: #ffffff;
}

#training_view #start_task,
#training_view #check_button,
#session_control_button,
.menu_navigation_button,
.view_actions button:first-child,
.choice_row button[aria-pressed="true"] {
  background-image: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  border-color: var(--accent-border);
  color: var(--accent-contrast);
}

.slider {
  background: var(--accent-track);
}

.slider::-webkit-slider-thumb {
  background: var(--accent-mid);
}

.slider::-moz-range-thumb {
  background: var(--accent-mid);
}

#training_view #answer_input {
  caret-color: var(--accent);
}

.cb_container input:checked ~ .checkmark {
  background-image: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  border-color: var(--accent-border);
}

/* Results use four equal cards for the usual fixed Practice summary. */
.result_metric_grid.result_metric_grid_four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result_metric_grid.result_metric_grid_six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Settings drawer */
.menu_box {
  box-sizing: border-box;
  max-width: 27rem;
  overflow: hidden;
  padding: 3.2rem 0.75rem 1rem;
}

.menu_wrapper {
  gap: 0.75rem;
}

.menu_settings_wrapper {
  gap: 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0.15rem 0.75rem;
  scrollbar-width: thin;
}

.menu_panel_heading {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.15rem 0.35rem 0.2rem;
}

.menu_panel_heading .section_kicker {
  font-size: 0.68rem;
  margin: 0;
}

.menu_panel_heading h2 {
  color: var(--text-strong);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.1;
  margin: 0.12rem 0 0;
}

.menu_panel_heading > span {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.25;
  max-width: 8rem;
  text-align: right;
}

.menu_navigation_button {
  align-items: center;
  display: flex;
  font-weight: 600;
  justify-content: space-between;
  margin: 0;
  min-height: 2.8rem;
  padding-inline: 0.9rem;
  width: 100%;
}

.menu_navigation_button span:last-child {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.menu_section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 0.8rem;
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
  margin: 0;
  min-width: 0;
  padding: 0.75rem;
}

.menu_section legend {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 0 0.3rem;
  text-transform: uppercase;
}

#font_size_layout {
  align-items: stretch;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 2.8rem minmax(0, 1fr) 2.8rem;
}

#font_size_layout .menu_button {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  color: var(--text-strong);
  font-size: 1.45rem;
  height: auto;
  margin: 0;
  min-width: 0;
}

#fs_task_display_box {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  color: var(--text-strong);
  height: 3rem;
}

#fs_font_size_display {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.theme_choice_grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

.theme_choice,
.accent_mode_choice {
  cursor: pointer;
  min-width: 0;
  position: relative;
}

.theme_choice input,
.accent_mode_choice input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.theme_choice {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.62rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  gap: 0.38rem;
  padding: 0.5rem 0.5rem;
  text-align: center;
}

.theme_choice:has(input:checked),
.accent_mode_choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.16rem color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--text-strong);
}

.theme_choice:has(input:focus-visible),
.accent_mode_choice:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.theme_choice_swatch {
  border: 1px solid rgba(128, 128, 128, 0.45);
  border-radius: 0.4rem;
  display: block;
  height: 1.55rem;
  width: min(100%, 3.6rem);
}

.theme_choice_light {
  background: linear-gradient(135deg, #ffffff 0 58%, #e7e7e7 58%);
}

.theme_choice_dark {
  background: linear-gradient(135deg, #2b2b2b 0 58%, #111111 58%);
}

.theme_choice_night {
  background: linear-gradient(135deg, #111111 0 48%, #000000 48%);
}

.accent_mode_grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
}

.accent_mode_choice {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.55rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem;
  text-align: center;
}

.hue_control {
  margin-top: 0.75rem;
  transition: opacity 150ms ease;
}

.hue_control.is_disabled {
  opacity: 0.48;
}

.hue_control_heading {
  align-items: baseline;
  color: var(--text-strong);
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

#theme_hue_value {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

#theme_hue {
  appearance: none;
  background: linear-gradient(90deg,
    hsl(0 72% 43%), hsl(30 72% 43%), hsl(60 72% 34%),
    hsl(90 72% 34%), hsl(120 72% 34%), hsl(150 72% 34%),
    hsl(180 72% 34%), hsl(210 72% 43%), hsl(240 72% 43%),
    hsl(270 72% 43%), hsl(300 72% 43%), hsl(330 72% 43%), hsl(360 72% 43%));
  border-radius: 999px;
  height: 0.8rem;
  outline: none;
  width: 100%;
}

#theme_hue::-webkit-slider-thumb {
  appearance: none;
  background: var(--surface);
  border: 0.18rem solid var(--text-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 0.12rem var(--surface);
  height: 1.35rem;
  width: 1.35rem;
}

#theme_hue::-moz-range-thumb {
  background: var(--surface);
  border: 0.18rem solid var(--text-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 0.12rem var(--surface);
  height: 1rem;
  width: 1rem;
}

#theme_hue:focus-visible {
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent) 28%, transparent);
}

.accent_preview {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  height: 0.55rem;
  margin-top: 0.65rem;
}

#theme_hue_help {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  margin: 0.45rem 0 0;
}

.menu_contact_wrapper {
  margin: auto 0 0;
}

#contact {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text-strong);
  margin: 0;
  width: 100%;
}

/* Difficulty and character-set fieldsets */
#manual_settings {
  display: grid;
  gap: 0.8rem;
}

.settings_fieldset {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  box-sizing: border-box;
  min-width: 0;
  padding: 0.65rem 0.75rem 0.8rem;
}

.settings_fieldset > legend {
  margin-left: 0.15rem;
}

.difficulty_grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#char_count_settings_layout,
#speed_settings_layout {
  margin: 0;
  min-width: 0;
  padding: 0.7rem;
}

.slidercontainer {
  align-items: center;
  display: grid;
  gap: 0.5rem 0.65rem;
  grid-template-areas:
    "label label"
    "slider output";
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
}

.slider_label {
  grid-area: label;
  min-width: 0;
  padding: 0;
}

.slidercontainer .slider {
  grid-area: slider;
  min-width: 0;
  width: 100%;
}

#chars_count,
#speed_count {
  grid-area: output;
  min-width: 2.2rem;
  padding: 0.15rem 0.35rem;
}

#adaptive_layout {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  grid-column: 1 / -1;
  margin: 0;
}

#adaptive_layout p {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
  margin: 0 0 0 1.6rem;
}

#character_settings #random_settings_layout,
#character_settings #custom_chars_layout {
  grid-column: auto;
}

#character_settings #random_settings_layout {
  padding: 0.2rem 0 0.5rem;
}

#character_settings #custom_chars_layout {
  padding: 0;
}

/* The expected sequence stays neutral; feedback belongs to the submitted answer. */
#answer_wrapper {
  min-width: 0;
}

.answer_review {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 0.7rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  display: flex;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  height: 3.45rem;
  justify-content: center;
  letter-spacing: 0.045em;
  line-height: 1;
  margin: 0.4rem 0;
  max-width: 30rem;
  overflow-x: auto;
  padding: 0.25rem 0.75rem;
  width: 100%;
}

.answer_review_correct {
  border-color: #6f942f;
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, #6f942f 18%, transparent);
}

.answer_review_wrong {
  border-color: #b94b4b;
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, #b94b4b 16%, transparent);
}

.answer_character_missing {
  opacity: 0.9;
  text-decoration-style: dashed;
}

.answer_character_inserted {
  text-decoration-style: double;
}

.answer_empty {
  color: var(--text-muted);
  font-size: 0.5em;
  letter-spacing: normal;
}

#training_view.session_active #task_display,
#training_view.session_active #answer_input,
#training_view.session_active .answer_review {
  font-size: 2em;
}

@media (max-width: 760px) {
  .result_metric_grid.result_metric_grid_four,
  .result_metric_grid.result_metric_grid_six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .difficulty_grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .menu_box {
    max-width: none;
    width: min(92%, 24rem);
  }

  .menu_panel_heading > span {
    display: none;
  }

  .theme_choice {
    font-size: 0.66rem;
  }

  #training_view.session_active .answer_review {
    height: 3.5rem;
    font-size: 2em;
  }
}

.light .menu_box {
  background: #f3f3f3;
}

.dark .menu_box {
  background: #111111;
}

.dark.er .menu_box {
  background: #030303;
}

.accent_black .theme_choice:has(input:checked),
.accent_black .accent_mode_choice:has(input:checked) {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 0.16rem color-mix(in srgb, var(--text-strong) 18%, transparent);
}


/* v19 interaction, registration and focus refinements */

/* Keep the status region out of the setup layout; JavaScript reveals it only
   while a session exists. */
#live_status[hidden] {
  display: none !important;
}

/* Registration numbers always contain seven characters, so retain the Length
   card in place but make its unavailable state explicit. */
#char_count_settings_layout {
  transition: opacity 160ms ease, background-color 160ms ease,
    border-color 160ms ease;
}

#char_count_settings_layout.is_disabled {
  background: color-mix(in srgb, var(--surface-quiet) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--border-soft) 72%, transparent);
  opacity: 0.48;
}

#char_count_settings_layout.is_disabled .slider_label,
#char_count_settings_layout.is_disabled output {
  color: var(--text-muted);
}

#char_count_settings_layout .slider:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
}

#adaptive_layout.is_disabled {
  opacity: 0.5;
}

/* Match Adaptive difficulty to the Character Set custom checkboxes. */
#adaptive_layout .cb_container {
  align-items: center;
  color: var(--text-strong);
  display: inline-flex;
  line-height: 1.4rem;
  min-height: 1.4rem;
  padding-left: 1.85rem;
}

#adaptive_layout .cb_container .checkmark {
  top: 0;
}

#adaptive_layout .cb_container input:disabled ~ .checkmark,
#adaptive_layout .cb_container input:disabled ~ span {
  cursor: not-allowed;
}

/* Disabled actions need a visibly inactive surface rather than a faded active
   gradient. This applies consistently to generated hue and black accents. */
#training_view #start_task:disabled,
#training_view #check_button:disabled,
.choice_row button:disabled,
.view_actions button:disabled,
.data_actions button:disabled,
.dialog_actions button:disabled {
  background: linear-gradient(90deg,
    var(--surface-quiet),
    color-mix(in srgb, var(--surface-quiet) 82%, var(--surface)),
    var(--surface-quiet)) !important;
  border-color: var(--border-soft) !important;
  box-shadow: none !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.72;
  transform: none;
}

/* A restrained, theme-aware keyboard focus treatment. The surface gap keeps
   the accent ring visible on selected gradient buttons in all appearances. */
button:focus,
input:focus {
  outline: none;
}

button:focus-visible,
.menu_btn:focus-visible,
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus-visible,
#contact:focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent)) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--surface) !important;
}

.choice_row button[aria-pressed="true"]:focus-visible,
.theme_choice:has(input:focus-visible),
.accent_mode_choice:has(input:focus-visible),
.menu_navigation_button:focus-visible,
#session_control_button:focus-visible,
#training_view #start_task:focus-visible,
#training_view #check_button:focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent)) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--surface),
    0 0.18rem 0.4rem color-mix(in srgb, var(--accent) 22%, transparent) !important;
}

.cb_container input:focus-visible ~ .checkmark,
.rbc_container input:focus-visible ~ .checkmark {
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--surface);
}

.slider:focus-visible,
#theme_hue:focus-visible {
  border-radius: 999px;
  box-shadow: none !important;
  outline: 2px solid var(--focus-ring, var(--accent)) !important;
  outline-offset: 7px;
}

.dark,
.dark.er {
  --focus-surface: var(--surface);
}

@media (prefers-reduced-motion: reduce) {
  #char_count_settings_layout {
    transition-duration: 0.01ms;
  }
}


#adaptive_layout.is_disabled label,
#adaptive_layout.is_disabled input {
  cursor: not-allowed;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  box-shadow: none !important;
  outline: none !important;
}

/* #manual_settings {
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  padding: 0;
} */

.transparent_card {
  background-color: #FFFFFF50;
  color: #777;
  font-size: 0.95em;
}

.dark .transparent_card {
  background-color: #00000050;
  color: #BBB;
  font-size: 0.95em;
}

.email_link {
  color: var(--accent);
  text-decoration: none;
}

.dark .email_link {
  color: hsl(from var(--accent) h s 85%)
}
/* Application update notice */
.update_notice {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 0.3rem solid var(--accent);
  border-radius: 0.75rem;
  bottom: 1rem;
  box-shadow: 0 0.65rem 1.8rem rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  left: 50%;
  max-width: min(38rem, calc(100% - 2rem));
  padding: 0.8rem 0.9rem;
  position: fixed;
  transform: translateX(-50%);
  width: max-content;
  z-index: 120;
}

.update_notice[hidden] {
  display: none;
}

.update_notice > div {
  display: grid;
  line-height: 1.35;
}

.update_notice strong {
  color: var(--text-strong);
}

.update_notice span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.update_notice button {
  background-image: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent-end));
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
}

.update_notice button:disabled {
  cursor: wait;
  filter: saturate(0.35);
  opacity: 0.75;
}

@media (max-width: 520px) {
  .update_notice {
    align-items: stretch;
    flex-direction: column;
    width: calc(100% - 1.5rem);
  }

  .update_notice button {
    width: 100%;
  }
}
