:root {
  --settings-btn-primary: var(--color-primary);
  --settings-btn-primary-text: var(--color-main-text);
  --settings-btn-light-text: #0e242f;
  --settings-btn-light: var(--color-primary-lighter);
  --settings-border: var(--color-border);
  --settings-border-contrast: var(--color-border-darker);
  --settings-text: var(--color-main-text);
  --settings-text-maxcontrast: var(--color-border-lighter);
  --settings-background: var(--color-main-background);
  --settings-background-hover: var(--color-background-dark);
  --settings-font-face:
    system-ui, -apple-system, 'Noto Sans', 'Segoe UI', Roboto, Oxygen-Sans,
    Cantarell, Ubuntu, 'Helvetica Neue', 'Liberation Sans', Arial, sans-serif;

  --default-font-size: 15px;
  --animation-quick: 100ms;
  --border-radius-element: 8px;
  --default-clickable-area: 34px;
  --default-grid-baseline: 4px;
  --color-text-lighter: var(--settings-text-maxcontrast);
  --color-scrollbar: var(--settings-border-contrast) transparent;
}

html {
  font-size: var(--default-font-size);
}
body {
  color: var(--settings-text);
  background-color: var(--settings-background);
  padding-left: 0px;
  margin-left: 0px;
  display: block;
  scrollbar-width: thin;
  font-family: var(--settings-font-face);
}

li {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
  cursor: default;
  scrollbar-color: var(--color-scrollbar);
}

a {
  color: #3273dc;
  cursor: pointer;
  text-decoration: none;
}

ul {
  padding: 0px;
}
.section {
  display: block;
  padding-top: 30px;
  margin-bottom: 24px;
  padding-left: 0px;
  padding-bottom: 10px;
}

.section {
  margin-bottom: 0;
}

.section:not(:last-child) {
  border-bottom: 1px solid var(--settings-border);
}

.section h3 {
  margin-bottom: 16px;
}

.section p {
  margin-top: -0.2em;
  margin-bottom: 1em;
  opacity: 0.7;
  max-width: 900px;
}

.button {
  --button-size: var(--default-clickable-area);
  --button-radius: var(--border-radius-element, calc(var(--button-size) / 2));
  --button-padding: clamp(
    var(--default-grid-baseline),
    var(--button-radius),
    calc(var(--default-grid-baseline) * 4)
  );
  position: relative;
  width: fit-content;
  overflow: hidden;
  border: 0;
  padding: 0;
  font-size: var(--default-font-size);
  font-weight: bold;
  min-height: var(--button-size);
  min-width: var(--button-size);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--button-radius);
  transition-property: color, border-color, background-color;
  transition-duration: 0.1s;
  transition-timing-function: linear;
  color: var(--settings-btn-light-text);
  background-color: var(--settings-btn-light);
}

.button:disabled {
  cursor: default;
  opacity: 0.5;
  filter: saturate(0.7);
}

.button--icon-and-text {
  --button-padding: min(
    calc(var(--default-grid-baseline) + var(--button-radius)),
    calc(var(--default-grid-baseline) * 4)
  );
  padding-block: 0;
  padding-inline: var(--default-grid-baseline) var(--button-padding);
}

.button-primary {
  color: var(--settings-btn-primary-text);
  background-color: var(--settings-btn-primary);
}

.button--vue-secondary {
  color: var(--settings-btn-light-text);
  background-color: var(--settings-btn-light);
}

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

.button__text {
  font-weight: bold;
  margin-bottom: 1px;
  padding: 2px 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.button__icon {
  height: var(--button-size);
  width: var(--button-size);
  min-height: var(--button-size);
  min-width: var(--button-size);
  display: flex;
  justify-content: center;
  align-items: center;
}
.material-design-icon {
  display: flex;
  align-self: center;
  justify-self: center;
  align-items: center;
  justify-content: center;
}

.button--vue-secondary {
  color: var(--settings-btn-light-text);
  background-color: var(--settings-btn-light);
}

.button--text-only {
  padding: 0 var(--button-padding);
}

.button--vue-tertiary {
  color: var(--settings-text);
  background-color: var(--settings-background);
}

.button--icon-only {
  line-height: 1;
  width: var(--button-size) !important;
}

.list-item {
  --list-item-padding: var(--default-grid-baseline);
  --list-item-height: 2lh;
  --list-item-border-radius: var(--border-radius-element, 32px);
  box-sizing: border-box;
  display: flex;
  position: relative;
  flex: 0 0 auto;
  justify-content: flex-start;
  padding: var(--list-item-padding);
  width: 100%;
  border-radius: var(--border-radius-element, 32px);
  cursor: pointer;
  transition: background-color var(--animation-quick) ease-in-out;
  list-style: none;
  border: 0.5px solid var(--settings-border);
  padding-right: 8px;
}

.list-item__wrapper {
  display: flex;
  position: relative;
  padding: 2px 4px;
}

.list-item__wrapper:last-of-type {
  padding-block-end: 4px;
}

.list-item__anchor {
  color: inherit;
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  height: var(--list-item-height);
  min-width: 0;
}

.list-item-content {
  display: flex;
  flex: 1 0;
  justify-content: space-between;
  padding-inline-start: calc(2 * var(--default-grid-baseline));
  min-width: 0;
}

.list-item-content__main {
  flex: 1 0;
  width: 0;
  margin: auto 0;
}

.list-item-content__name {
  min-width: 100px;
  flex: 1 1 10%;
  font-weight: 500;
}

.list-item__wrapper .list-item-content__name,
.list-item__wrapper .list-item-content__subname,
.list-item__wrapper .list-item-content__details,
.list-item__wrapper .list-item-details__details {
  white-space: nowrap;
  margin-block: 0;
  margin-inline: 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-content__extra-actions {
  display: flex;
  align-items: center;
  gap: var(--default-grid-baseline);
}

.list-item-content__actions,
.list-item-content__extra-actions {
  flex: 0 0 auto;
  align-self: center;
  justify-content: center;
  margin-inline-start: var(--default-grid-baseline);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--settings-background);
  padding: 20px;
  width: 400px;
  max-width: 90%;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  font-size: 21px;
  text-align: center;
  margin: 0 0 16px;
}

.dic-input-container {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.dic-input-container input[type='text'] {
  flex: 1;
  padding: 8px;
  font-size: 15px;
  border: 1px solid var(--settings-border);
  border-radius: 4px;
  color: var(--settings-text);
  background-color: var(--settings-background);
}

.view-input-container {
  margin: 16px 0;
}

.view-input-container h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--settings-text);
}

.view-setting-description {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9em;
  line-height: 1.5;
}

.view-setting-description a {
  text-decoration: underline;
}

.view-setting-small-label {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

.view-input-container input[type='text'] {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid var(--settings-border);
  border-radius: 4px;
  color: var(--settings-text);
  background-color: var(--settings-background);
  transition: border-color 0.2s ease;
}

.view-input-container input[type='text']:focus {
  outline: none;
  border-color: var(--settings-btn-primary);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}


.wordbook-add-button {
  padding: 8px;
  margin: 0px 5px;
}

#dicWordList {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

#dicWordList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

#dicWordList li button {
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.dic-button-container,
.modal-button-container {
  display: flex;
  justify-content: end;
  margin-top: 24px;
}

.dic-button-container button,
.modal-button-container button {
  padding: 8px 16px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.dic-dropdown-container {
  position: relative;
  margin-bottom: 16px;
  cursor: pointer;
  border: 1px solid var(--settings-border-contrast);
  border-radius: 4px;
  background-color: var(--settings-background);
  padding: 8px;
}

.dic-dropdown-container::after {
  content: '▾';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.8em;
  color: var(--color-text-lighter);
}

.dic-dropdown-container .open {
  border: 1px solid var(--settings-border-contrast);
}

.dic-dropdown-container.open::after {
  content: '▴';
}

.dic-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--settings-background);
  border: 1px solid var(--settings-border);
  border-radius: 4px;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}

.dic-dropdown-option {
  padding: 8px;
  border: 1px solid var(--settings-border-contrast);
}

.dic-dropdown-option:hover {
  background-color: var(--settings-background-hover);
}

.dic-dropdown-description {
  font-size: 0.8em;
  color: var(--color-text-lighter);
  line-height: 1.2;
}

.dic-select-container {
  display: flex;
  margin-bottom: 16px;
}

.dic-select-container select {
  padding: 8px;
  font-size: var(--default-font-size);
  border: 1px solid var(--settings-border);
  border-radius: 4px;
  background-color: var(--settings-background);
  color: var(--settings-text);
}

#xcu-section {
  margin: 16px 0;
  padding: 10px;
}

.material-design-icon__svg {
  width: var(--icon-size, 24px);
  height: var(--icon-height, 24px);
}

.xcu-editor-tabs-nav, .browser-setting-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--settings-border);
}

.xcu-editor-tab, .browser-setting-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 0;
  position: relative;
  font-size: var(--default-font-size);
  color: var(--settings-text);
  text-align: center;
  cursor: pointer;
  transition: color 0.2s ease;
  min-height: 40px;
}

.xcu-editor-tab::after,
.browser-setting-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 25%;
  width: 50%;
  height: 4px;
  background-color: transparent;
  transition: background-color 0.2s ease;
}

.xcu-editor-tab.active,
.browser-setting-tab.active {
  color: var(--settings-btn-primary);
}

.xcu-editor-tab.active::after,
.browser-setting-tab.active::after {
  background-color: var(--settings-btn-primary);
}

.xcu-settings-fieldset,
.view-settings-fieldset {
  border: 1px solid var(--settings-border);
  padding: 10px;
  margin: 10px 0;
}

.xcu-settings-fieldset legend,
.view-settings-fieldset legend {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 4px;
}

.checkbox-wrapper {
  --icon-size: 24px;
  --icon-height: 24px;
}

.checkbox-radio-switch {
  display: flex;
  align-items: center;
  color: var(--settings-text);
  background-color: rgba(0, 0, 0, 0);
  font-size: var(--default-font-size);
  line-height: var(--default-line-height);
  padding: 0;
  position: relative;
  --checkbox-radio-switch--border-radius: var(
    --border-radius-element,
    calc(var(--default-clickable-area) / 2)
  );
  --checkbox-radio-switch--border-radius-outer: calc(
    var(--checkbox-radio-switch--border-radius) + 2px
  );
}

.checkbox-radio-switch-input {
  width: 18px;
  height: 18px;
  margin: 4px calc((var(--default-clickable-area) - 16px) / 2);
}

.checkbox-content--has-text {
  padding-inline-end: calc((var(--default-clickable-area) - 16px) / 2);
}

.checkbox-content {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: var(--default-grid-baseline);
  user-select: none;
  min-height: var(--default-clickable-area);
  border-radius: var(--checkbox-radio-switch--border-radius);
  padding: var(--default-grid-baseline)
    calc((var(--default-clickable-area) - var(--icon-height)) / 2);
  width: 100%;
  max-width: fit-content;
}

.checkbox-content {
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-content__inner {
    display: flex;
    flex-direction: column;
}

.checkbox-content--with-warning {
    align-items: flex-start;
}

.xcu-settings-grid,
.browser-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.xcu-editor-actions,
.browser-settings-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
  margin-right: 10px;
  margin-bottom: 10px;
}

.custom-compact-toggle {
	margin: 1rem 0rem;
}

.toggle-options {
	display: flex;
	gap: 2rem;
	margin-top: 0.5rem;
}

.toggle-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
}

.toggle-image {
	width: 300px;
	height: auto;
	border: 2px solid transparent;
	border-radius: 6px;
	max-width: 100%;
	box-sizing: border-box;
}

.toggle-image.selected {
	border-color: var(--co-settings-text, #e5eff5);
	background-color: rgba(0, 120, 212, 0.1);
}

.toggle-image-label {
	margin-top: 1rem;
	font-size: var(--default-font-size);
	color: var(--settings-text);
}

.signature-textarea {
	width: 100%;
	max-width: 80vw;
	min-height: calc(var(--default-grid-baseline) * 30); 
	resize: vertical;
	font-family: monospace;
	font-size: calc(var(--default-font-size) * 0.8);
	line-height: 1.4;
	border: 1px solid var(--settings-border);
	padding: calc(var(--default-grid-baseline) * 2) calc(var(--default-grid-baseline) * 3);
	border-radius: var(--border-radius-element);
	background-color: var(--settings-background);
	color: var(--settings-text);
	transition: border-color calc(var(--animation-quick) * 2) ease;
	box-sizing: border-box;
}

.signature-textarea:focus {
	outline: none;
	border-color: var(--settings-btn-primary);
	box-shadow: 0 0 0 calc(var(--default-grid-baseline) / 2) rgba(0, 120, 212, 0.1);
}
