@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,400&display=swap");

/*
! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com
*/

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box;
  /* 1 */
  border-width: 0;
  /* 2 */
  border-style: solid;
  /* 2 */
  border-color: #e5e7eb;
  /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
*/

html {
  line-height: 1.5;
  /* 1 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
  -moz-tab-size: 4;
  /* 3 */
  -o-tab-size: 4;
     tab-size: 4;
  /* 3 */
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  /* 4 */
  font-feature-settings: normal;
  /* 5 */
  font-variation-settings: normal;
  /* 6 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0;
  /* 1 */
  line-height: inherit;
  /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0;
  /* 1 */
  color: inherit;
  /* 2 */
  border-top-width: 1px;
  /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font family by default.
2. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  /* 1 */
  font-size: 1em;
  /* 2 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0;
  /* 1 */
  border-color: inherit;
  /* 2 */
  border-collapse: collapse;
  /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  /* 1 */
  font-feature-settings: inherit;
  /* 1 */
  font-variation-settings: inherit;
  /* 1 */
  font-size: 100%;
  /* 1 */
  font-weight: inherit;
  /* 1 */
  line-height: inherit;
  /* 1 */
  color: inherit;
  /* 1 */
  margin: 0;
  /* 2 */
  padding: 0;
  /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button;
  /* 1 */
  background-color: transparent;
  /* 2 */
  background-image: none;
  /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield;
  /* 1 */
  outline-offset: -2px;
  /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button;
  /* 1 */
  font: inherit;
  /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/

dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1;
  /* 1 */
  color: #9ca3af;
  /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  /* 1 */
  color: #9ca3af;
  /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/

:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  /* 1 */
  vertical-align: middle;
  /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */

[hidden] {
  display: none;
}

*, ::before, ::after{
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
}

::backdrop{
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
}

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

.pointer-events-none{
  pointer-events: none;
}

.visible{
  visibility: visible;
}

.collapse{
  visibility: collapse;
}

.static{
  position: static;
}

.absolute{
  position: absolute;
}

.relative{
  position: relative;
}

.right-0{
  right: 0px;
}

.right-3{
  right: 0.75rem;
}

.top-0{
  top: 0px;
}

.top-1\/2{
  top: 50%;
}

.col-span-full{
  grid-column: 1 / -1;
}

.mx-auto{
  margin-left: auto;
  margin-right: auto;
}

.my-4{
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.my-6{
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.mb-1{
  margin-bottom: 0.25rem;
}

.mb-10{
  margin-bottom: 2.5rem;
}

.mb-2{
  margin-bottom: 0.5rem;
}

.mb-3{
  margin-bottom: 0.75rem;
}

.mb-4{
  margin-bottom: 1rem;
}

.mb-6{
  margin-bottom: 1.5rem;
}

.mb-8{
  margin-bottom: 2rem;
}

.ml-1{
  margin-left: 0.25rem;
}

.ml-2{
  margin-left: 0.5rem;
}

.ml-auto{
  margin-left: auto;
}

.mt-0{
  margin-top: 0px;
}

.mt-0\.5{
  margin-top: 0.125rem;
}

.mt-2{
  margin-top: 0.5rem;
}

.mt-4{
  margin-top: 1rem;
}

.mt-6{
  margin-top: 1.5rem;
}

.mt-8{
  margin-top: 2rem;
}

.mt-auto{
  margin-top: auto;
}

.line-clamp-3{
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.block{
  display: block;
}

.inline{
  display: inline;
}

.flex{
  display: flex;
}

.inline-flex{
  display: inline-flex;
}

.table{
  display: table;
}

.grid{
  display: grid;
}

.hidden{
  display: none;
}

.h-12{
  height: 3rem;
}

.h-3{
  height: 0.75rem;
}

.h-3\.5{
  height: 0.875rem;
}

.h-4{
  height: 1rem;
}

.h-5{
  height: 1.25rem;
}

.h-56{
  height: 14rem;
}

.h-6{
  height: 1.5rem;
}

.h-full{
  height: 100%;
}

.max-h-64{
  max-height: 16rem;
}

.max-h-\[60vh\]{
  max-height: 60vh;
}

.min-h-0{
  min-height: 0px;
}

.min-h-\[250px\]{
  min-height: 250px;
}

.min-h-\[4rem\]{
  min-height: 4rem;
}

.min-h-screen{
  min-height: 100vh;
}

.w-12{
  width: 3rem;
}

.w-16{
  width: 4rem;
}

.w-3{
  width: 0.75rem;
}

.w-3\.5{
  width: 0.875rem;
}

.w-4{
  width: 1rem;
}

.w-5{
  width: 1.25rem;
}

.w-6{
  width: 1.5rem;
}

.w-full{
  width: 100%;
}

.min-w-0{
  min-width: 0px;
}

.max-w-4xl{
  max-width: 56rem;
}

.max-w-5xl{
  max-width: 64rem;
}

.max-w-max{
  max-width: -moz-max-content;
  max-width: max-content;
}

.max-w-md{
  max-width: 28rem;
}

.flex-1{
  flex: 1 1 0%;
}

.flex-shrink-0{
  flex-shrink: 0;
}

.shrink-0{
  flex-shrink: 0;
}

.-translate-y-1\/2{
  --tw-translate-y: -50%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.rotate-180{
  --tw-rotate: 180deg;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

@keyframes spin{
  to{
    transform: rotate(360deg);
  }
}

.animate-spin{
  animation: spin 1s linear infinite;
}

.cursor-pointer{
  cursor: pointer;
}

.select-none{
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.resize-none{
  resize: none;
}

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

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

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

.flex-col{
  flex-direction: column;
}

.flex-wrap{
  flex-wrap: wrap;
}

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

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

.items-baseline{
  align-items: baseline;
}

.items-stretch{
  align-items: stretch;
}

.justify-start{
  justify-content: flex-start;
}

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

.justify-center{
  justify-content: center;
}

.justify-between{
  justify-content: space-between;
}

.gap-1{
  gap: 0.25rem;
}

.gap-2{
  gap: 0.5rem;
}

.gap-3{
  gap: 0.75rem;
}

.gap-4{
  gap: 1rem;
}

.gap-6{
  gap: 1.5rem;
}

.gap-x-2{
  -moz-column-gap: 0.5rem;
       column-gap: 0.5rem;
}

.space-x-2 > :not([hidden]) ~ :not([hidden]){
  --tw-space-x-reverse: 0;
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

.space-y-1 > :not([hidden]) ~ :not([hidden]){
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}

.space-y-2 > :not([hidden]) ~ :not([hidden]){
  --tw-space-y-reverse: 0;
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}

.space-y-3 > :not([hidden]) ~ :not([hidden]){
  --tw-space-y-reverse: 0;
  margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
}

.space-y-4 > :not([hidden]) ~ :not([hidden]){
  --tw-space-y-reverse: 0;
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}

.space-y-6 > :not([hidden]) ~ :not([hidden]){
  --tw-space-y-reverse: 0;
  margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
}

.overflow-hidden{
  overflow: hidden;
}

.overflow-y-auto{
  overflow-y: auto;
}

.truncate{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whitespace-nowrap{
  white-space: nowrap;
}

.rounded{
  border-radius: 0.25rem;
}

.rounded-full{
  border-radius: 9999px;
}

.rounded-lg{
  border-radius: 0.5rem;
}

.rounded-xl{
  border-radius: 0.75rem;
}

.border{
  border-width: 1px;
}

.border-2{
  border-width: 2px;
}

.border-b{
  border-bottom-width: 1px;
}

.border-t{
  border-top-width: 1px;
}

.border-dashed{
  border-style: dashed;
}

.border-none{
  border-style: none;
}

.border-\[var\(--accent-olive\)\]{
  border-color: var(--accent-olive);
}

.border-\[var\(--border-dark\)\]{
  border-color: var(--border-dark);
}

.border-\[var\(--border-light\)\]{
  border-color: var(--border-light);
}

.border-\[var\(--error\)\]{
  border-color: var(--error);
}

.border-gray-200{
  --tw-border-opacity: 1;
  border-color: rgb(229 231 235 / var(--tw-border-opacity));
}

.bg-\[var\(--accent-olive\)\]{
  background-color: var(--accent-olive);
}

.bg-\[var\(--bg-aged\)\]{
  background-color: var(--bg-aged);
}

.bg-\[var\(--bg-cream\)\]{
  background-color: var(--bg-cream);
}

.bg-\[var\(--bg-paper\)\]{
  background-color: var(--bg-paper);
}

.bg-\[var\(--bg-secondary\)\]{
  background-color: var(--bg-secondary);
}

.bg-\[var\(--bg-warm\)\]{
  background-color: var(--bg-warm);
}

.bg-\[var\(--error\)\]{
  background-color: var(--error);
}

.object-contain{
  -o-object-fit: contain;
     object-fit: contain;
}

.p-1{
  padding: 0.25rem;
}

.p-2{
  padding: 0.5rem;
}

.p-3{
  padding: 0.75rem;
}

.p-4{
  padding: 1rem;
}

.p-6{
  padding: 1.5rem;
}

.p-8{
  padding: 2rem;
}

.px-2{
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3{
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4{
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6{
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-1{
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2{
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3{
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4{
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-6{
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.py-8{
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.pb-20{
  padding-bottom: 5rem;
}

.pb-24{
  padding-bottom: 6rem;
}

.pb-3{
  padding-bottom: 0.75rem;
}

.pb-4{
  padding-bottom: 1rem;
}

.pt-1{
  padding-top: 0.25rem;
}

.pt-2{
  padding-top: 0.5rem;
}

.pt-3{
  padding-top: 0.75rem;
}

.pt-4{
  padding-top: 1rem;
}

.pt-6{
  padding-top: 1.5rem;
}

.text-left{
  text-align: left;
}

.text-center{
  text-align: center;
}

.font-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.font-serif{
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.text-2xl{
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl{
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.text-4xl{
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.text-5xl{
  font-size: 3rem;
  line-height: 1;
}

.text-6xl{
  font-size: 3.75rem;
  line-height: 1;
}

.text-\[10px\]{
  font-size: 10px;
}

.text-base{
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg{
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-sm{
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-xl{
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-xs{
  font-size: 0.75rem;
  line-height: 1rem;
}

.font-bold{
  font-weight: 700;
}

.font-medium{
  font-weight: 500;
}

.font-normal{
  font-weight: 400;
}

.font-semibold{
  font-weight: 600;
}

.uppercase{
  text-transform: uppercase;
}

.italic{
  font-style: italic;
}

.leading-snug{
  line-height: 1.375;
}

.tracking-wide{
  letter-spacing: 0.025em;
}

.tracking-widest{
  letter-spacing: 0.1em;
}

.text-\[var\(--accent-olive\)\]{
  color: var(--accent-olive);
}

.text-\[var\(--accent-terracotta\)\]{
  color: var(--accent-terracotta);
}

.text-\[var\(--error\)\]{
  color: var(--error);
}

.text-\[var\(--fg-black\)\]{
  color: var(--fg-black);
}

.text-\[var\(--fg-light\)\]{
  color: var(--fg-light);
}

.text-\[var\(--fg-muted\)\]{
  color: var(--fg-muted);
}

.text-\[var\(--success\)\]{
  color: var(--success);
}

.text-\[var\(--warning\)\]{
  color: var(--warning);
}

.text-gray-400{
  --tw-text-opacity: 1;
  color: rgb(156 163 175 / var(--tw-text-opacity));
}

.text-gray-700{
  --tw-text-opacity: 1;
  color: rgb(55 65 81 / var(--tw-text-opacity));
}

.text-white{
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity));
}

.opacity-60{
  opacity: 0.6;
}

.shadow{
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.shadow-\[2px_2px_0_var\(--accent-olive\)\]{
  --tw-shadow: 2px 2px 0 var(--accent-olive);
  --tw-shadow-colored: 2px 2px 0 var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.shadow-md{
  --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.outline-none{
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.ring-2{
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.ring-\[var\(--accent-olive\)\]{
  --tw-ring-color: var(--accent-olive);
}

.ring-offset-2{
  --tw-ring-offset-width: 2px;
}

.\!filter{
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;
}

.filter{
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.transition-all{
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-colors{
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-opacity{
  transition-property: opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-transform{
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-200{
  transition-duration: 200ms;
}

:root {
  /* Colors */
  --bg-cream: #f7f4ee;
  --bg-paper: #fdfbf7;
  --bg-aged: #ede8dd;
  --bg-warm: #f0ebe1;
  --fg-black: #1a1915;
  --fg-muted: #6b665a;
  --fg-light: #9a9590;
  --accent-olive: #3d4535;
  --accent-terracotta: #a65d3f;
  --accent-gold: #8b7355;
  --accent-sage: #6b7b5e;
  --border-light: #d4cfc3;
  --border-dark: #1a1915;
  --success: #4a6b4a;
  --warning: #a67c3f;
  --error: #8b4545;
  /* Алиасы для совместимости */
  --bg-primary: var(--bg-cream);
  --bg-secondary: var(--bg-aged);
  --border-color: var(--border-dark);
  --border-subtle: var(--border-light);
  --fg: var(--fg-black);
  --fg-primary: var(--fg-black);
  --accent: var(--accent-olive);
  --muted: var(--fg-muted);
  --accent-olive-subtle: color-mix(in srgb, var(--accent-olive) 40%, transparent);
  --backdrop: color-mix(in srgb, var(--fg-black) 60%, transparent);
  --token-highlight: #D2D5C3;
  --token-highlight-active: #D2D5C3;
  /* Animation Timing */
  --anima-duration-fast: 100ms;
  --anima-duration-medium: 150ms;
  --anima-duration-normal: 200ms;
  --anima-duration-slow: 300ms;
  --anima-duration-entrance: 350ms;
  --anima-ease-paper: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --anima-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --anima-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Safe Area Insets с fallback */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-xxxl: 64px;
  --font-serif: "Cormorant Garamond", serif;
  --font-mono: "DM Mono", monospace;
  /* Rounded */
  --rounded-none: 0px;
  --rounded-sm: 2px;
  --rounded-md: 4px;
  --rounded-lg: 8px;
  --rounded-full: 50%;
  /* Shadows */
  --shadow-offset-x: 6px;
  --shadow-offset-y: 6px;
  --shadow-color: var(--border-dark);
  --shadow-offset-lg: 8px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-cream);
  color: var(--fg-black);
  line-height: 1.6;
  margin: 0;
}

/* Touch оптимизация */

button,
[role="button"],
a,
input[type="button"],
input[type="submit"],
.cursor-pointer {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.font-serif {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

.paper-texture::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

.btn {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  color: var(--fg-black);
  cursor: pointer;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper),
        border-color var(--anima-duration-normal) var(--anima-ease-paper);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

@media (min-width: 640px) {
  .btn {
    font-size: 11px;
    letter-spacing: 0.15em;
    padding: 14px 28px;
  }
}

.btn::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--border-dark);
  opacity: 0;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
  pointer-events: none;
}

@media (min-width: 640px) {
  .btn::before {
    inset: 3px;
  }
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-filled {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.btn-filled:hover {
  background: var(--bg-paper);
  color: var(--fg-black);
}

.btn-olive {
  border-color: var(--accent-olive);
  background: var(--accent-olive);
  color: var(--bg-paper);
}

.btn-olive:hover {
  background: var(--bg-paper);
  color: var(--accent-olive);
}

.btn-olive::before {
  border-color: var(--accent-olive);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-paper);
  color: var(--fg-black);
  border-color: var(--border-dark);
}

.btn-ghost::before {
  /* display: none; — removed per design system, inherits base .btn::before */
}

.btn-sm {
  padding: 6px 10px;
  font-size: 8px;
}

@media (min-width: 640px) {
  .btn-sm {
    padding: 8px 16px;
    font-size: 9px;
  }
}

.btn-lg {
  padding: 18px 36px;
  font-size: 12px;
}

.input-field {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  color: var(--fg-black);
  width: 100%;
  transition: box-shadow var(--anima-duration-normal) var(--anima-ease-paper), background-color var(--anima-duration-normal) var(--anima-ease-paper), color var(--anima-duration-normal) var(--anima-ease-paper);
}

.input-field:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--border-dark);
}

.input-field::-moz-placeholder {
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.input-field::placeholder {
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.input-field:disabled {
  background: var(--bg-aged);
  color: var(--fg-muted);
  cursor: not-allowed;
}

.card {
  background: var(--bg-paper);
  border: 1px solid var(--border-dark);
  padding: 24px;
  position: relative;
}

.border-none {
  border: none;
}

.card-shadow::after {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--shadow-offset-y));
  right: calc(-1 * var(--shadow-offset-x));
  width: 100%;
  height: 100%;
  border: 1px solid var(--shadow-color);
  z-index: -1;
  background: var(--bg-aged);
}

.card-selectable {
  cursor: pointer;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper), border-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.card-selectable:hover {
  background: var(--bg-aged);
}

.card-selectable.selected {
  border-color: var(--accent-olive);
  background: var(--bg-warm);
}

.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-paper);
  color: var(--fg-muted);
  display: inline-block;
}

.tag-filled {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.tag-olive {
  background: var(--accent-olive);
  color: var(--bg-paper);
  border-color: var(--accent-olive);
}

.tag-terracotta {
  background: var(--accent-terracotta);
  color: var(--bg-paper);
  border-color: var(--accent-terracotta);
}

.tag-sage {
  background: var(--accent-sage);
  color: var(--bg-paper);
  border-color: var(--accent-sage);
}

/* Clickable Tag — интерактивный фильтр/chip */

.tag-clickable {
  border-color: var(--border-dark);
  color: var(--fg-black);
  background: var(--bg-paper);
  cursor: pointer;
  position: relative;
  transition: transform var(--anima-duration-fast) var(--anima-ease-paper),
        background-color var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper),
        border-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.tag-clickable::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--border-dark);
  opacity: 0;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
  pointer-events: none;
}

.tag-clickable:hover::before {
  opacity: 1;
}

.tag-clickable:hover {
  background: var(--fg-black);
  color: var(--bg-paper);
  transform: translateY(-1px);
}

.tag-clickable:active {
  transform: translateY(1px) scale(0.98);
}

/* Цветные варианты clickable */

.tag-clickable.tag-filled {
  background: var(--fg-black);
  color: var(--bg-paper);
  border-color: var(--fg-black);
}

.tag-clickable.tag-filled:hover {
  background: var(--bg-paper);
  color: var(--fg-black);
}

.tag-clickable.tag-olive {
  background: var(--accent-olive);
  color: var(--bg-paper);
  border-color: var(--accent-olive);
}

.tag-clickable.tag-olive:hover {
  background: var(--bg-paper);
  color: var(--accent-olive);
}

.tag-clickable.tag-olive::before {
  border-color: var(--accent-olive);
}

.tag-clickable.tag-terracotta {
  background: var(--accent-terracotta);
  color: var(--bg-paper);
  border-color: var(--accent-terracotta);
}

.tag-clickable.tag-terracotta:hover {
  background: var(--bg-paper);
  color: var(--accent-terracotta);
}

.tag-clickable.tag-terracotta::before {
  border-color: var(--accent-terracotta);
}

.tag-clickable.tag-sage {
  background: var(--accent-sage);
  color: var(--bg-paper);
  border-color: var(--accent-sage);
}

.tag-clickable.tag-sage:hover {
  background: var(--bg-paper);
  color: var(--accent-sage);
}

.tag-clickable.tag-sage::before {
  border-color: var(--accent-sage);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
}

.checkbox-container input {
  display: none;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-dark);
  position: relative;
  flex-shrink: 0;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.checkbox-container input:checked+.checkbox-box::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--fg-black);
}

.checkbox-container:hover .checkbox-box {
  background: var(--bg-aged);
}

.radio-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
}

.radio-container input {
  display: none;
}

.radio-box {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-dark);
  border-radius: var(--rounded-full);
  position: relative;
  flex-shrink: 0;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.radio-container input:checked+.radio-box::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--fg-black);
  border-radius: var(--rounded-full);
}

.radio-container:hover .radio-box {
  background: var(--bg-aged);
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
}

.toggle-container input {
  display: none;
}

.toggle-track {
  width: 44px;
  height: 24px;
  border: 1px solid var(--border-dark);
  position: relative;
  transition: background-color var(--anima-duration-slow) var(--anima-ease-paper), border-color var(--anima-duration-slow) var(--anima-ease-paper);
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  top: 3px;
  left: 3px;
  transition: left var(--anima-duration-slow) var(--anima-ease-paper), background-color var(--anima-duration-slow) var(--anima-ease-paper);
}

.toggle-container input:checked+.toggle-track {
  background: var(--fg-black);
}

.toggle-container input:checked+.toggle-track::after {
  left: 23px;
  background: var(--bg-paper);
}

.divider {
  height: 1px;
  background: var(--border-dark);
}

.divider-double {
  height: 3px;
  background: transparent;
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border: none;
  background: var(--bg-aged);
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
}

.label-frame {
  border: 1px solid var(--border-dark);
  padding: 20px;
  position: relative;
  background: var(--bg-paper);
}

.label-frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--border-dark);
  pointer-events: none;
}

.stamp {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 2px solid var(--accent-terracotta);
  color: var(--accent-terracotta);
  transform: rotate(-3deg);
  display: inline-block;
  position: relative;
}

.stamp::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--accent-terracotta);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-paper);
  border: 1px solid var(--border-dark);
  padding: 32px;
  max-width: 640px;
  width: 90%;
  z-index: 101;
}

.modal-content::after {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--shadow-offset-lg));
  right: calc(-1 * var(--shadow-offset-lg));
  width: 100%;
  height: 100%;
  border: 1px solid var(--shadow-color);
  z-index: -1;
  background: var(--bg-aged);
}

/* --- Drawer Component --- */

@keyframes drawerSlideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes drawerSlideInBottom {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.drawer-content {
  position: fixed;
  background: var(--bg-paper);
  border: 1px solid var(--border-dark);
  z-index: 101;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

/* Декоративная тень в стиле твоего приложения */

.drawer-content::after {
  content: "";
  position: absolute;
  z-index: -1;
  background: var(--bg-aged);
  border: 1px solid var(--border-dark);
}

/* Мобильная версия: выезжает снизу, 80% высоты */

@media (max-width: 639px) {
  .drawer-content {
    bottom: 0;
    left: 0;
    right: 0;
    height: 80vh;
    border-bottom: none;
    animation: drawerSlideInBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .drawer-content::after {
    top: -8px;
    left: 8px;
    right: -8px;
    height: 100%;
  }
}

/* Десктопная версия: выезжает справа, 80% ширины */

@media (min-width: 640px) {
  .drawer-content {
    top: 0;
    right: 0;
    bottom: 0;
    width: 80vw;
    max-width: 800px;
    border-right: none;
    animation: drawerSlideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .drawer-content::after {
    top: 8px;
    left: -8px;
    bottom: -8px;
    width: 100%;
  }
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  /* Небольшой отступ для скроллбара */
}

/* ------------------------ */

.dropdown {
  position: relative;
}

.dropdown-trigger {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  color: var(--fg-black);
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper), color var(--anima-duration-normal) var(--anima-ease-paper), border-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.dropdown-trigger::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--fg-black);
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper);
}

.dropdown.active .dropdown-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-paper);
  border: 1px solid var(--border-dark);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper), visibility var(--anima-duration-normal) var(--anima-ease-paper), transform var(--anima-duration-normal) var(--anima-ease-paper);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color var(--anima-duration-fast) var(--anima-ease-paper), color var(--anima-duration-fast) var(--anima-ease-paper);
  border-bottom: 1px solid var(--border-light);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.dropdown-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--bg-paper);
  z-index: 1;
}

.dropdown-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.dropdown-search input:focus {
  outline: none;
  box-shadow: 2px 2px 0 var(--border-dark);
}

.dropdown-search input::-moz-placeholder {
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.dropdown-search input::placeholder {
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.dropdown-items {
  max-height: 220px;
  overflow-y: auto;
}

.alert {
  border: 1px solid var(--border-dark);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-paper);
}

.alert-success {
  border-left: 4px solid var(--success);
}

.alert-warning {
  border-left: 4px solid var(--warning);
}

.alert-error {
  border-left: 4px solid var(--error);
}

.alert-info {
  border-left: 4px solid var(--fg-black);
}

.progress-track {
  height: 8px;
  border: 1px solid var(--border-dark);
  background: var(--bg-aged);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: var(--progress-width, 0%);
  background: var(--fg-black);
  transition: width 0.5s ease;
}

.progress-container {
  position: relative;
}

.progress-track-lesson {
  height: 3px;
  border: 1px solid var(--border-light);
  background: var(--bg-aged);
  position: relative;
  overflow: hidden;
}

.progress-fill-core {
  height: 100%;
  background: var(--fg-black);
  transition: width 0.5s ease;
}

.progress-fill-phrase {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent-sage);
  transition: width 0.5s ease, left 0.5s ease;
}

.progress-divider {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 8px;
  background: var(--border-dark);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stepper-number {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-paper);
  transition: background-color var(--anima-duration-slow) var(--anima-ease-paper), border-color var(--anima-duration-slow) var(--anima-ease-paper), color var(--anima-duration-slow) var(--anima-ease-paper);
}

.stepper-step.active .stepper-number {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.stepper-step.completed .stepper-number {
  background: var(--accent-olive);
  border-color: var(--accent-olive);
  color: var(--bg-paper);
}

.stepper-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.stepper-step.active .stepper-label,
.stepper-step.completed .stepper-label {
  color: var(--fg-black);
}

.stepper-line {
  flex-grow: 1;
  height: 1px;
  background: var(--border-dark);
  opacity: 0.3;
}

.stepper-step.completed+.stepper-line {
  opacity: 1;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-dark);
}

.tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 24px;
  cursor: pointer;
  position: relative;
  color: var(--fg-muted);
  transition: color var(--anima-duration-normal) var(--anima-ease-paper);
  background: transparent;
  border: none;
}

.tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fg-black);
  transform: scaleX(0);
  transition: transform var(--anima-duration-slow) var(--anima-ease-paper);
}

.tab:hover {
  color: var(--fg-black);
}

.tab.active {
  color: var(--fg-black);
}

.tab.active::after {
  transform: scaleX(1);
}

.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg-black);
  color: var(--bg-paper);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper), visibility var(--anima-duration-normal) var(--anima-ease-paper);
  z-index: 50;
  /* Prevent invisible tooltip from intercepting pointer events */
  pointer-events: none;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--fg-black);
}

.tooltip-container:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.accordion-item-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.accordion-item {
  border: 1px solid var(--border-dark);
  border-bottom: none;
}

.accordion-item:last-child {
  border-bottom: 1px solid var(--border-dark);
}

.accordion-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--bg-paper);
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.accordion-header:hover {
  background: var(--bg-aged);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  position: relative;
  flex-shrink: 0;
}

.accordion-icon::before,
.accordion-icon::after {
  content: "";
  position: absolute;
  background: var(--fg-black);
  transition: transform var(--anima-duration-slow) var(--anima-ease-paper), opacity var(--anima-duration-slow) var(--anima-ease-paper);
}

.accordion-icon::before {
  width: 100%;
  height: 1px;
  top: 50%;
  transform: translateY(-50%);
}

.accordion-icon::after {
  width: 1px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.accordion-item.active .accordion-icon::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--bg-aged);
}

.accordion-item.active .accordion-content {
  max-height: 200px;
}

.accordion-body {
  padding: 20px;
}

.table-container {
  border: 1px solid var(--border-dark);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-aged);
  border-bottom: 1px solid var(--border-dark);
  font-weight: 400;
}

.table td {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: var(--bg-warm);
}

.avatar {
  min-width: 48px;
  height: 48px;
  border: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  background: var(--bg-paper);
  padding: 0 12px;
}

.avatar-sm {
  min-width: 32px;
  height: 32px;
  font-size: 10px;
  padding: 0 8px;
}

.avatar-lg {
  min-width: 64px;
  height: 64px;
  font-size: 14px;
  padding: 0 16px;
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  margin-left: -12px;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: transform var(--anima-duration-fast) var(--anima-ease-paper),
        background-color var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper);
}

.pagination-btn:hover {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.pagination-btn.active {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.breadcrumbs a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--anima-duration-normal) var(--anima-ease-paper);
}

.breadcrumbs a:hover {
  color: var(--fg-black);
}

.breadcrumbs span {
  color: var(--fg-black);
}

.search-container {
  position: relative;
}

.search-input {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  width: 100%;
  transition: box-shadow var(--anima-duration-normal) var(--anima-ease-paper);
}

.search-input:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--border-dark);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
}

/* Алиас для обратной совместимости */

.skeleton {
  background: linear-gradient(90deg,
            var(--bg-aged) 0%,
            var(--bg-paper) 50%,
            var(--bg-aged) 100%);
  background-size: 200% 100%;
  animation: anima-skeleton-paper 2s ease-in-out infinite;
}

@keyframes anima-skeleton-paper {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* --- Bottom Tab Bar (Mobile Navigation) --- */

.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-cream);
  border-top: 1px solid var(--border-dark);
  display: flex;
  z-index: 50;
  width: 100%;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.bottom-tab-bar::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 4px;
  right: -4px;
  height: 4px;
  background: var(--border-dark);
}

.bottom-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: var(--fg-muted);
  opacity: 0.6;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper),
        background-color var(--anima-duration-normal) var(--anima-ease-paper);
  position: relative;
  text-decoration: none;
  min-width: 0;
}

.bottom-tab-item:hover {
  opacity: 0.8;
}

.bottom-tab-item.active {
  color: var(--fg-black);
  opacity: 1;
}

.bottom-tab-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--fg-black);
}

.bottom-tab-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-tab-item-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* === SIDEBAR === */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 192px;
  height: 100vh;
  background-color: var(--bg-cream);
  border-right: 1px solid var(--border-dark);
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  opacity: 0.6;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper),
        background-color var(--anima-duration-normal) var(--anima-ease-paper);
}

.sidebar-item:hover {
  color: var(--accent-terracotta);
  background-color: var(--bg-aged);
  opacity: 1;
}

.sidebar-item.active {
  color: var(--fg-black);
  opacity: 1;
  background-color: var(--bg-warm);
}

.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 24px;
  background-color: var(--fg-black);
  transform: translateY(-50%);
}

.sidebar-item:focus-visible {
  outline: 1px solid var(--accent-terracotta);
  outline-offset: -1px;
}

.sidebar-item-label {
  font-family: var(--font-mono);
  font-size: 11px;
}

.sidebar-footer {
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.sidebar-footer .avatar-sm {
  flex-shrink: 0;
}

.main-with-sidebar {
  margin-left: 192px;
  min-height: 100vh;
}

@media (max-width: 1023px) {
  .sidebar {
    display: none !important;
  }

  .main-with-sidebar {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-item {
    transition: none;
  }
}

.furigana-text {
  display: inline;
}

.furigana-ruby {
  font-family: var(--font-serif);
  ruby-align: center;
}

.furigana-rt {
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--fg-muted);
}

.furigana-plain {
  font-family: var(--font-serif);
}

.furigana-hidden .furigana-rt {
  opacity: 0;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
}

.furigana-hidden:hover .furigana-rt {
  opacity: 1;
}

/* === Translator Text === */

.translator-text {
  display: inline;
  font-family: var(--font-serif);
}

.translator-loading {
  opacity: 0.6;
}

.token-word {
  position: relative;
  display: inline;
  cursor: pointer;
  border-bottom: 1px dotted var(--accent-olive-subtle);
  transition: background-color var(--anima-duration-medium) linear, border-color var(--anima-duration-medium) linear;
}

.token-word:hover,
.token-word:focus-visible {
  background: var(--token-highlight);
  border-bottom: 1px solid var(--accent-olive);
  outline: none;
}

.token-word:active {
  background: var(--accent-olive);
  color: var(--bg-paper);
}

.token-word-active {
  border-bottom: 1px solid var(--accent-olive);
  background: var(--token-highlight-active);
}

.token-plain {
  display: inline;
}

.token-popup {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 16px 20px;
  margin-top: 8px;
  background: var(--bg-paper);
  border: 1px solid var(--border-dark);
  z-index: 50;
}

.token-popup::after {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--shadow-offset-y));
  right: calc(-1 * var(--shadow-offset-x));
  width: 100%;
  height: 100%;
  border: 1px solid var(--shadow-color);
  background: var(--bg-aged);
  z-index: -1;
}

.token-popup-surface {
  font-family: var(--font-serif);
  font-size: 20px;
}

.token-popup-reading {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.kanji-animation-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kanji-animation-svg {
  width: 109px;
  height: 109px;
}

.kanji-animation-svg path:not(.bg) {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: kanji-draw 0.4s linear forwards;
}

.kanji-animation-svg path.bg {
  stroke: var(--fg-light);
  stroke-width: 0.5;
}

@keyframes kanji-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.kanji-frames-svg {
  max-width: 100%;
  width: 100%;
  height: auto;
}

.kanji-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 109px;
  height: 109px;
  font-size: 64px;
  font-family: serif;
}

.kanji-frames-svg svg {
  max-width: 100%;
  width: 100%;
  height: auto;
}

.kanji-frames-svg path.active {
  stroke: var(--fg-black);
}

.kanji-frames-svg path.not.active {
  stroke: var(--fg-light);
}

.kanji-writing-section {
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 16px;
}

.kanji-writing-grid {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

.sets-page {
  padding: 24px 0;
}

.sets-group {
  margin-bottom: 32px;
}

.markdown-text {
  font-family: var(--font-mono);
  color: var(--fg-black);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.markdown-text h1,
.markdown-text h2,
.markdown-text h3,
.markdown-text h4,
.markdown-text h5,
.markdown-text h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0.5em 0;
  color: var(--fg-black);
}

.markdown-text h1 {
  font-size: 1.5em;
}

.markdown-text h2 {
  font-size: 1.25em;
}

.markdown-text h3 {
  font-size: 1.1em;
}

.markdown-text h4 {
  font-size: 1em;
}

.markdown-text h5 {
  font-size: 0.9em;
}

.markdown-text h6 {
  font-size: 0.8em;
}

.markdown-text p {
  margin: 0.5em 0;
}

.markdown-text strong {
  font-weight: 600;
}

.markdown-text em {
  font-style: italic;
}

.markdown-text ul,
.markdown-text ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.markdown-text li {
  margin: 0.25em 0;
}

.markdown-text code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-aged);
  padding: 0.1em 0.3em;
}

.markdown-text pre {
  background: var(--bg-aged);
  padding: 0.75em;
  overflow-x: auto;
  margin: 0.5em 0;
}

.markdown-text pre code {
  background: none;
  padding: 0;
}

.markdown-text a {
  color: var(--accent-olive);
  text-decoration: underline;
}

.markdown-text a:hover {
  color: var(--accent-terracotta);
}

.markdown-text blockquote {
  border-left: 2px solid var(--border-dark);
  padding-left: 1em;
  margin: 0.5em 0;
  color: var(--fg-muted);
  font-style: italic;
}

.markdown-text hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1em 0;
}

.markdown-text table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
}

.markdown-text th,
.markdown-text td {
  border: 1px solid var(--border-light);
  padding: 0.5em;
  text-align: left;
}

.markdown-text th {
  background: var(--bg-aged);
  font-weight: 500;
}

.prose-xs {
  font-size: 10px;
}

.prose-sm {
  font-size: 12px;
}

.prose-lg {
  font-size: 16px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-light);
  border-top-color: var(--fg-black);
  border-radius: var(--rounded-full);
  animation: spinner-rotate 0.8s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg-paper) 90%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
}

.loading-overlay-message {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-light);
  border-top-color: currentColor;
  border-radius: var(--rounded-full);
  animation: spinner-rotate 0.8s linear infinite;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.btn-text {
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.btn-text-hidden {
  opacity: 0;
}

.toast-container {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
  max-width: 360px;
}

.toast {
  border: 1px solid var(--border-dark);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-paper);
  box-shadow: 4px 4px 0 var(--border-dark);
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-error {
  border-left: 4px solid var(--error);
}

.toast-info {
  border-left: 4px solid var(--fg-black);
}

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--fg-muted);
  transition: color var(--anima-duration-normal) var(--anima-ease-paper);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--fg-black);
}

.toast-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-progress .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--fg-muted);
  border-top-color: transparent;
  border-radius: var(--rounded-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.quiz-option-neutral {
  background: var(--bg-paper);
  border-color: var(--border-dark);
}

.quiz-option-neutral:hover {
  background: var(--bg-aged);
}

.quiz-option-correct {
  background: var(--bg-warm);
  border-color: var(--success);
  color: var(--success);
}

.quiz-option-wrong {
  background: var(--bg-warm);
  border-color: var(--error);
  color: var(--error);
}

.quiz-option-dimmed {
  background: var(--bg-paper);
  border-color: var(--border-light);
  opacity: 0.5;
}

.btn.quiz-option-correct {
  background: var(--bg-warm);
  border-color: var(--success);
  color: var(--success);
}

.btn.quiz-option-correct:hover {
  background: var(--bg-warm);
  color: var(--success);
}

.btn.quiz-option-correct::before {
  border-color: var(--success);
}

.btn.quiz-option-wrong {
  background: var(--bg-warm);
  border-color: var(--error);
  color: var(--error);
}

.btn.quiz-option-wrong:hover {
  background: var(--bg-warm);
  color: var(--error);
}

.btn.quiz-option-wrong::before {
  border-color: var(--error);
}

.btn.quiz-option-dimmed {
  background: var(--bg-paper);
  border-color: var(--border-light);
}

.btn.quiz-option-dimmed:hover {
  background: var(--bg-paper);
  color: var(--fg-black);
}

/* === Kанадзи Drawing Container === */

.kanji-drawing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* === Canvas стили в стиле проекта === */

.kanji-drawing-canvas-wrapper {
  position: relative;
}

.kanji-drawing-canvas-wrapper::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--border-dark);
  z-index: -1;
  background: var(--bg-aged);
  pointer-events: none;
}

.kanji-drawing-canvas {
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  touch-action: none;
  cursor: crosshair;
  width: min(320px, 85vw);
  height: min(320px, 85vw);
}

.kanji-drawing-info {
  text-align: center;
  margin: 15px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.kanji-drawing-success {
  color: var(--success);
  font-size: 14px;
  font-family: var(--font-mono);
}

.kanji-drawing-progress {
  color: var(--fg-muted);
}

.kanji-drawing-controls {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.kanji-drawing-reset-btn {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
  color: var(--fg-black);
  cursor: pointer;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper), color var(--anima-duration-normal) var(--anima-ease-paper);
}

.kanji-drawing-reset-btn:hover {
  background: var(--fg-black);
  color: var(--bg-paper);
}

.kanji-drawing-reset-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--border-dark);
  pointer-events: none;
}

.kanji-drawing-loading {
  text-align: center;
  padding: 40px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.kanji-drawing-error {
  text-align: center;
  padding: 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--error);
}

/* ============================================
   ANIMATION SYSTEM - Origa UI
   ============================================

   Использование: добавьте классы вида anima-* к элементам
   Например: <div class="card anima-lift">

   Категории:
   - Standard: anima-press, anima-lift, anima-reveal
   - Hover: anima-card-lift, anima-tag-hover, anima-link-typewriter, anima-btn-press
   - Entrance: anima-modal-enter, anima-backdrop-enter, anima-toast-bounce
   - Exit: anima-modal-exit, anima-backdrop-exit, anima-toast-exit
   - Micro: anima-shake, anima-check-draw, anima-strikethrough
   - Loading: anima-skeleton-paper, anima-spinner-square
   - Japanese: anima-kanji-reveal, anima-furigana-show
   - Layout: anima-stagger, anima-page-fade, anima-slide-up
   - Special: anima-stamp, anima-pulse-subtle, anima-focus-ring

   Accessibility: prefers-reduced-motion отключает все анимации
   ============================================
*/

/* === STANDARD ANIMATION SYSTEM === */

/* Press — для кнопок/действий ("нажатие клавиши пишущей машинки") */

.anima-press {
  transition: transform var(--anima-duration-fast) var(--anima-ease-paper);
}

.anima-press:active {
  transform: translateY(1px) scale(0.98);
}

/* Lift — для карточек/объектов ("поднятие листа бумаги") */

.anima-lift {
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper),
        box-shadow var(--anima-duration-normal) var(--anima-ease-paper);
}

.anima-lift:hover {
  transform: translateY(-2px);
}

.anima-lift:active {
  transform: translateY(0);
}

/* Reveal — для навигации ("маркер на тексте", без движения) */

.anima-reveal {
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper),
        background-color var(--anima-duration-normal) var(--anima-ease-paper);
}

/* === 1. HOVER АНИМАЦИИ === */

/* Deprecated: use anima-lift */

/* Карточка приподнимается при hover */

.anima-card-lift {
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper),
        box-shadow var(--anima-duration-normal) var(--anima-ease-paper);
}

.anima-card-lift:hover {
  transform: translateY(-2px);
}

.anima-card-lift:hover.card-shadow::after {
  transform: translate(var(--shadow-offset-x), var(--shadow-offset-y));
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper);
}

/* Deprecated: use tag-clickable */

/* Тег - наклон при hover */

.anima-tag-hover {
  transition: transform var(--anima-duration-fast) var(--anima-ease-paper);
}

.anima-tag-hover:hover {
  transform: translateY(-1px) rotate(-1deg);
}

/* Ссылка - печатное подчёркивание */

.anima-link-typewriter {
  position: relative;
  text-decoration: none;
}

.anima-link-typewriter::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper);
}

.anima-link-typewriter:hover::after {
  transform: scaleX(1);
}

/* Deprecated: use anima-press */

/* Кнопка - нажатие */

.anima-btn-press:active {
  transform: translateY(1px);
  transition: transform var(--anima-duration-fast) var(--anima-ease-paper);
}

/* Аватар - масштабирование при hover */

.anima-avatar-hover {
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper),
        box-shadow var(--anima-duration-normal) var(--anima-ease-paper),
        background-color var(--anima-duration-normal) var(--anima-ease-paper);
  cursor: pointer;
}

.anima-avatar-hover:hover {
  transform: scale(1.08);
  box-shadow: 2px 2px 0 var(--border-dark);
  background: var(--bg-aged);
}

/* === 2. ПОЯВЛЕНИЕ/ИСЧЕЗНОВЕНИЕ === */

/* Модальное окно - вход */

@keyframes anima-modal-enter {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 20px)) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.anima-modal-enter {
  animation: anima-modal-enter var(--anima-duration-entrance) var(--anima-ease-out-expo) forwards;
}

/* Backdrop */

@keyframes anima-backdrop-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 0.6;
  }
}

.anima-backdrop-enter {
  animation: anima-backdrop-enter var(--anima-duration-slow) ease forwards;
}

/* Toast - улучшенный вход с лёгким bounce */

@keyframes anima-toast-bounce {
  0% {
    opacity: 0;
    transform: translateX(20px) translateY(-10px);
  }

  60% {
    opacity: 1;
    transform: translateX(0) translateY(2px);
  }

  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

.anima-toast-bounce {
  animation: anima-toast-bounce 0.4s var(--anima-ease-out-back) forwards;
}

/* === 3. ГЛУБИНА И СЛОИ === */

/* Stamp-эффект (для важных меток) */

@keyframes anima-stamp {
  0% {
    transform: scale(1.3) rotate(-15deg);
    opacity: 0;
  }

  60% {
    transform: scale(0.95) rotate(-2deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(-3deg);
    opacity: 1;
  }
}

.anima-stamp {
  animation: anima-stamp 0.4s var(--anima-ease-out-back) forwards;
}

/* === 4. ФОКУС И ВНИМАНИЕ === */

/* Мягкая пульсация */

@keyframes anima-pulse-subtle {
  0%,
    100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.anima-pulse-subtle {
  animation: anima-pulse-subtle 2s ease-in-out infinite;
}

/* Focus ring для keyboard navigation */

.anima-focus-ring:focus-visible {
  outline: 2px solid var(--accent-terracotta);
  outline-offset: 2px;
  transition: outline-offset var(--anima-duration-fast) var(--anima-ease-paper);
}

/* === 5. МИКРОВЗАИМОДЕЙСТВИЯ === */

/* Тряска при ошибке */

@keyframes anima-shake {
  0%,
    100% {
    transform: translateX(0);
  }

  10%,
    30%,
    50%,
    70%,
    90% {
    transform: translateX(-4px);
  }

  20%,
    40%,
    60%,
    80% {
    transform: translateX(4px);
  }
}

.anima-shake {
  animation: anima-shake 0.5s ease;
}

/* Галочка рисуется */

@keyframes anima-check-draw {
  from {
    stroke-dashoffset: 24;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.anima-check-draw {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: anima-check-draw 0.3s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Зачёркивание */

.anima-strikethrough {
  position: relative;
}

.anima-strikethrough::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--anima-duration-normal) var(--anima-ease-paper);
}

.anima-strikethrough.active::after {
  transform: scaleX(1);
}

/* === 6. LOADING СОСТОЯНИЯ === */

/* Skeleton с бумажной текстурой - улучшенный */

.anima-skeleton-paper {
  background: linear-gradient(90deg,
            var(--bg-aged) 0%,
            var(--bg-paper) 50%,
            var(--bg-aged) 100%);
  background-size: 200% 100%;
  animation: anima-skeleton-paper 2s ease-in-out infinite;
}

/* Квадратный spinner в стиле проекта */

@keyframes anima-spinner-square {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(90deg);
  }

  50% {
    transform: rotate(180deg);
  }

  75% {
    transform: rotate(270deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.anima-spinner-square {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  animation: anima-spinner-square 1.2s steps(4) infinite;
}

/* === 7. ЯПОНСКАЯ СПЕЦИФИКА === */

/* Появление иероглифа - fade in + scale */

@keyframes anima-kanji-reveal {
  0% {
    opacity: 0;
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.anima-kanji-reveal {
  animation: anima-kanji-reveal var(--anima-duration-slow) var(--anima-ease-paper) forwards;
}

/* Furigana появление */

@keyframes anima-furigana-show {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anima-furigana-show {
  animation: anima-furigana-show var(--anima-duration-fast) ease forwards;
}

/* === 8. STAGGER (каскадное появление) === */

@keyframes anima-stagger-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anima-stagger>* {
  opacity: 0;
  animation: anima-stagger-fade var(--anima-duration-slow) var(--anima-ease-out-expo) forwards;
}

.anima-stagger>*:nth-child(1) {
  animation-delay: 0ms;
}

.anima-stagger>*:nth-child(2) {
  animation-delay: 50ms;
}

.anima-stagger>*:nth-child(3) {
  animation-delay: 100ms;
}

.anima-stagger>*:nth-child(4) {
  animation-delay: 150ms;
}

.anima-stagger>*:nth-child(5) {
  animation-delay: 200ms;
}

.anima-stagger>*:nth-child(6) {
  animation-delay: 250ms;
}

.anima-stagger>*:nth-child(7) {
  animation-delay: 300ms;
}

.anima-stagger>*:nth-child(8) {
  animation-delay: 350ms;
}

.anima-stagger>*:nth-child(9) {
  animation-delay: 400ms;
}

.anima-stagger>*:nth-child(10) {
  animation-delay: 450ms;
}

/* === 9. PAGE TRANSITIONS === */

@keyframes anima-page-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.anima-page-fade {
  animation: anima-page-fade var(--anima-duration-slow) ease forwards;
}

/* Mobile-friendly slide up */

@keyframes anima-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anima-slide-up {
  animation: anima-slide-up var(--anima-duration-entrance) var(--anima-ease-out-expo) forwards;
}

/* === 10. ACCESSIBILITY === */

/* Отключение анимаций для prefers-reduced-motion */

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

/* Класс для полного отключения анимаций */

.anima-none {
  animation: none !important;
  transition: none !important;
}

/* === EXIT ANIMATIONS === */

/* Modal exit - обратное к появлению */

@keyframes anima-modal-exit {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 20px)) scale(0.98);
  }
}

.anima-modal-exit {
  animation: anima-modal-exit 0.25s ease-in forwards;
}

/* Backdrop exit - fade out */

@keyframes anima-backdrop-exit {
  from {
    opacity: 0.6;
  }

  to {
    opacity: 0;
  }
}

.anima-backdrop-exit {
  animation: anima-backdrop-exit 0.2s ease forwards;
}

/* Toast exit - slide out */

@keyframes anima-toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.anima-toast-exit {
  animation: anima-toast-exit 0.2s ease-in forwards;
}

/* === CONNECTIVITY BANNER === */

.connectivity-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--warning);
  color: var(--bg-paper);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-dark);
  animation: slideDown 0.3s ease-out;
}

.banner-icon {
  font-size: 14px;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

/* Searchable dropdown overrides */

.searchable .dropdown-menu {
  max-height: 280px;
  overflow-y: auto;
}

/* === AUDIT FIX: Component-specific styles === */

/* Alert */

.alert-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.alert-message {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* Toast */

.toast-content {
  flex: 1;
}

.toast-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toast-message {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* Progress */

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.progress-value {
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Modal/Drawer */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.modal-close-btn {
  color: var(--fg-muted);
  transition: color var(--anima-duration-normal) var(--anima-ease-paper);
}

.modal-close-btn:hover {
  color: var(--fg-black);
}

/* Stepper */

.stepper-label-desktop {
  display: none;
}

@media (min-width: 768px) {
  .stepper-label-desktop {
    display: block;
  }
}

.stepper-line-inactive {
  opacity: 0.3;
}

/* Typography */

.heading-h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.75rem, 6vw, 3rem);
  line-height: 1.2;
  word-break: break-words;
  letter-spacing: -0.02em;
}

.heading-h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.5rem;
}

.heading-h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
}

.heading-h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.125rem;
}

.heading-h5 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1rem;
}

.heading-h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.875rem;
}

.text-primary {
  color: var(--fg-black);
}

.text-muted {
  color: var(--fg-muted);
}

.text-olive {
  color: var(--accent-olive);
}

.display-text {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  line-height: 1.2;
  word-break: break-words;
  color: var(--fg-black);
}

/* Layout */

.page-layout-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

@media (min-width: 640px) {
  .page-layout-centered {
    padding: 24px;
  }
}

.page-layout-full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 8px;
}

@media (min-width: 640px) {
  .page-layout-full {
    padding: 16px;
  }
}

.page-layout-compact {
  min-height: calc(100vh - 4rem);
  padding: 16px;
}

@media (min-width: 640px) {
  .page-layout-compact {
    padding: 24px;
  }
}

.card-layout-small {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.card-layout-medium {
  max-width: 768px;
  width: 100%;
  margin: 0 auto;
}

.card-layout-large {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
}

.card-layout-adaptive {
  width: 100%;
}

.card-layout-content {
  background: var(--bg-cream);
  padding: 16px;
}

@media (min-width: 640px) {
  .card-layout-content {
    padding: 24px;
  }
}

@media (min-width: 1024px) {
  .card-layout-content {
    padding: 32px;
  }
}

/* Accordion */

.accordion-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.accordion-body {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}

/* Collapsible */

.collapsible-toggle {
  margin-top: 4px;
}

/* === MISSING UTILITY CLASSES === */

/* Accessibility */

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

/* Line clamp */

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pointer events */

.pointer-events-none {
  pointer-events: none;
}

/* Banner text */

.banner-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Kanji loading */

.kanji-loading {
  text-align: center;
  padding: 40px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Tab button */

.tab-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tab-button-icon {
  font-size: 20px;
  line-height: 1;
}

.tab-button-text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 4px;
}

.tab-button-active {
  color: var(--accent-olive);
}

.tab-button-inactive {
  color: var(--fg-muted);
}

/* Reading group */

.reading-group {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.reading-main {
  flex: 1;
  min-width: 0;
}

.reading-kanji {
  width: 64px;
  flex-shrink: 0;
  padding-top: 4px;
}

.reading-furigana {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reading-tag {
  display: inline-block;
  padding: 4px 8px;
  background: var(--bg-aged);
  font-size: 12px;
}

/* Progress inline width helper */

.progress-inline {
  transition: width 0.5s ease;
}

/* Accordion max-height transition */

.accordion-max-height {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-max-height-open {
  max-height: 200px;
}

/* Skeleton base */

.skeleton-base {
  background: linear-gradient(90deg,
            var(--bg-aged) 0%,
            var(--bg-paper) 50%,
            var(--bg-aged) 100%);
  background-size: 200% 100%;
  animation: anima-skeleton-paper 2s ease-in-out infinite;
}

/* App skeleton */

.app-skeleton {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-cream);
}

.app-skeleton-content {
  width: 100%;
  max-width: 800px;
  padding: 24px;
}

.app-skeleton-card {
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid var(--border-dark);
  background: var(--bg-paper);
}

.app-skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-skeleton-line {
  height: 16px;
}

/* Audio buttons */

.audio-buttons {
  display: flex;
  gap: 8px;
  padding: 4px;
}

.audio-btn {
  color: var(--fg-muted);
  transition: color var(--anima-duration-normal) var(--anima-ease-paper);
}

.audio-btn:hover {
  color: var(--fg-black);
}

.audio-btn:disabled {
  opacity: 0.3;
}

.audio-btn-spin {
  animation: spin 1.5s linear infinite;
}

.card-history-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-aged);
}

.card-history-date {
  font-family: var(--font-mono);
  font-size: 11px;
}

.card-history-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.card-history-empty {
  padding: 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}

/* Chart */

.chart-container {
  font-family: var(--font-mono);
}

.chart-label {
  font-size: 10px;
}

/* Delete button */

.delete-button {
  cursor: pointer;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
}

.delete-button:hover {
  opacity: 0.7;
}

.delete-button svg {
  width: 16px;
  height: 16px;
}

/* Favorite button */

.favorite-button {
  cursor: pointer;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
}

.favorite-button:hover {
  opacity: 0.7;
}

.favorite-button svg {
  width: 16px;
  height: 16px;
}

/* History button */

.history-button {
  cursor: pointer;
  transition: opacity var(--anima-duration-normal) var(--anima-ease-paper);
}

.history-button:hover {
  opacity: 0.7;
}

.history-button svg {
  width: 16px;
  height: 16px;
}

/* Delete confirm modal */

.delete-confirm-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.delete-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Drawer header */

.drawer-header {
  font-family: var(--font-serif);
  font-size: 24px;
  margin-top: 4px;
}

/* OCR loading stage */

.ocr-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ocr-stage-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ocr-stage-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.ocr-stage-status {
  font-family: var(--font-mono);
  font-size: 11px;
}

.ocr-stage-description {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.ocr-stage-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ocr-stage-indicator {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ocr-stage-content {
  flex: 1;
  min-width: 0;
}

.ocr-stage-icon-success {
  color: var(--success);
}

.ocr-stage-icon-error {
  color: var(--error);
}

.ocr-stage-icon-pending {
  color: var(--fg-muted);
}

.ocr-stage-text-pending {
  color: var(--fg-muted);
}

.ocr-stage-text-processing {
  color: var(--accent-olive);
}

.ocr-stage-text-success {
  color: var(--success);
}

.ocr-stage-text-error {
  color: var(--error);
}

.ocr-stage-bg-warm {
  background: var(--bg-warm);
}

.ocr-stage-border-pending {
  border-color: var(--border-light);
}

.ocr-stage-border-processing {
  border-color: var(--accent-olive);
}

.ocr-stage-border-success {
  border-color: var(--success);
}

.ocr-stage-border-error {
  border-color: var(--error);
}

/* Update drawer */

.update-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--backdrop);
}

.update-drawer-content {
  width: 100%;
  max-width: 480px;
  margin: 0 16px;
  padding: 24px;
  background: var(--bg-cream);
  border: 1px solid var(--border-dark);
}

.update-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.update-drawer-icon {
  width: 24px;
  height: 24px;
}

.update-drawer-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-olive);
}

.update-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-drawer-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
}

/* Typography extras */

.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 14px;
}

.text-xl {
  font-size: 20px;
}

.text-2xl {
  font-size: 24px;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-widest {
  letter-spacing: 0.15em;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

/* Layout extras */

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.w-4 {
  width: 16px;
}

.h-4 {
  height: 16px;
}

.w-5 {
  width: 20px;
}

.h-5 {
  height: 20px;
}

.w-16 {
  width: 64px;
}

.h-16 {
  height: 64px;
}

.min-w-0 {
  min-width: 0;
}

.shrink-0 {
  flex-shrink: 0;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.inline-block {
  display: inline-block;
}

.grid {
  display: grid;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

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

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

.items-end {
  align-items: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

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

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.gap-8 {
  gap: 32px;
}

.gap-12 {
  gap: 48px;
}

.space-y-1>*+* {
  margin-top: 4px;
}

.space-y-2>*+* {
  margin-top: 8px;
}

.space-y-4>*+* {
  margin-top: 16px;
}

.space-y-5>*+* {
  margin-top: 20px;
}

.p-1 {
  padding: 4px;
}

.p-4 {
  padding: 16px;
}

.p-6 {
  padding: 24px;
}

.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}

.py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}

.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.py-8 {
  padding-top: 32px;
  padding-bottom: 32px;
}

.py-16 {
  padding-top: 64px;
  padding-bottom: 64px;
}

.mt-0 {
  margin-top: 0;
}

.mt-0\.5 {
  margin-top: 2px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-8 {
  margin-top: 32px;
}

.mt-24 {
  margin-top: 96px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-8 {
  margin-bottom: 32px;
}

.mb-12 {
  margin-bottom: 48px;
}

.mx-4 {
  margin-left: 16px;
  margin-right: 16px;
}

.-mb-px {
  margin-bottom: -1px;
}

.rounded {
  border-radius: var(--rounded-sm);
}

.rounded-xl {
  border-radius: var(--rounded-lg);
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.top-0 {
  top: 0;
}

.right-0 {
  right: 0;
}

.bottom-0 {
  bottom: 0;
}

.left-0 {
  left: 0;
}

.z-10 {
  z-index: 10;
}

.z-20 {
  z-index: 20;
}

.z-50 {
  z-index: 50;
}

.hidden {
  display: none;
}

.inline {
  display: inline;
}

.block {
  display: block;
}

.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-200 {
  transition-duration: 200ms;
}

.leading-relaxed {
  line-height: 1.625;
}

.text-\[var\(--fg-muted\)\] {
  color: var(--fg-muted);
}

.text-\[var\(--fg-black\)\] {
  color: var(--fg-black);
}

.text-\[var\(--accent-olive\)\] {
  color: var(--accent-olive);
}

.text-\[var\(--accent-terracotta\)\] {
  color: var(--accent-terracotta);
}

.text-\[var\(--success\)\] {
  color: var(--success);
}

.text-\[var\(--error\)\] {
  color: var(--error);
}

.text-\[var\(--fg-light\)\] {
  color: var(--fg-light);
}

.bg-\[var\(--bg-aged\)\] {
  background: var(--bg-aged);
}

.bg-\[var\(--bg-warm\)\] {
  background: var(--bg-warm);
}

.bg-\[var\(--bg-paper\)\] {
  background: var(--bg-paper);
}

.bg-\[var\(--bg-cream\)\] {
  background: var(--bg-cream);
}

.bg-black\/80 {
  background: color-mix(in srgb, var(--fg-black) 80%, transparent);
}

.border {
  border-width: 1px;
  border-style: solid;
}

.border-\[var\(--border-light\)\] {
  border-color: var(--border-light);
}

.border-\[var\(--border-dark\)\] {
  border-color: var(--border-dark);
}

.border-\[var\(--accent-olive\)\] {
  border-color: var(--accent-olive);
}

.border-\[var\(--success\)\] {
  border-color: var(--success);
}

.border-\[var\(--error\)\] {
  border-color: var(--error);
}

.hover\:opacity-70:hover {
  opacity: 0.7;
}

.hover\:text-\[var\(--fg-black\)\]:hover {
  color: var(--fg-black);
}

.hover\:text-\[var\(--accent-terracotta\)\]:hover {
  color: var(--accent-terracotta);
}

.disabled\:opacity-30:disabled {
  opacity: 0.3;
}

@media (min-width: 640px) {
  .sm\:px-6 {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 768px) {
  .md\:flex {
    display: flex;
  }

  .md\:flex-row {
    flex-direction: row;
  }

  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .lg\:px-8 {
    padding-left: 32px;
    padding-right: 32px;
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* JLPT Step Options */

.jlpt-option {
  border: 1px solid var(--border-dark);
}

.jlpt-option.selected {
  border: 2px solid var(--accent-olive);
  background: var(--bg-warm);
}

.jlpt-option-radio {
  border: 1px solid var(--border-dark);
}

.jlpt-option.selected .jlpt-option-radio {
  border: 1px solid var(--accent-olive);
}

.jlpt-option-radio-check {
  inset: 3px;
  background: var(--fg-black);
}

/* CardActionBar */

.card-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border-dark);
  padding-top: 8px;
  margin-top: 8px;
  min-height: 32px;
}

.card-action-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-black);
  cursor: pointer;
  transition: background-color var(--anima-duration-normal) var(--anima-ease-paper),
        border-color var(--anima-duration-normal) var(--anima-ease-paper),
        color var(--anima-duration-normal) var(--anima-ease-paper);
}

.icon-btn:hover {
  background: var(--bg-aged);
  border-color: var(--border-dark);
}

.icon-btn-danger:hover {
  color: var(--error);
  border-color: var(--error);
}

@media (max-width: 639px) {
  .icon-btn {
    min-width: 36px;
    min-height: 36px;
  }
}

@media (max-width: 360px) {
  .bottom-tab-item-label {
    display: none;
  }
}

/* ============================================
   THEME SYSTEM
   ============================================
   Default (light) theme lives in :root.
   Future themes override via data-theme attribute:
   <html data-theme="dark">
   ============================================
*/

[data-theme] {
  /* Structural hook: all tokens inherit from :root by default.
       Override specific --* variables in named themes below. */
}

[data-theme="dark"] {
  /* Placeholder: add dark palette overrides here */
}

.last\:border-0:last-child{
  border-width: 0px;
}

.hover\:bg-\[var\(--bg-aged\)\]:hover{
  background-color: var(--bg-aged);
}

.hover\:bg-\[var\(--bg-hover\)\]:hover{
  background-color: var(--bg-hover);
}

.hover\:bg-\[var\(--error\)\]:hover{
  background-color: var(--error);
}

.hover\:text-\[var\(--error\)\]:hover{
  color: var(--error);
}

.hover\:text-\[var\(--fg-black\)\]:hover{
  color: var(--fg-black);
}

.hover\:opacity-80:hover{
  opacity: 0.8;
}

.group:hover .group-hover\:opacity-100{
  opacity: 1;
}

@media (min-width: 640px){
  .sm\:mb-12{
    margin-bottom: 3rem;
  }

  .sm\:mb-4{
    margin-bottom: 1rem;
  }

  .sm\:mb-6{
    margin-bottom: 1.5rem;
  }

  .sm\:mb-8{
    margin-bottom: 2rem;
  }

  .sm\:inline{
    display: inline;
  }

  .sm\:min-h-\[300px\]{
    min-height: 300px;
  }

  .sm\:w-auto{
    width: auto;
  }

  .sm\:min-w-\[240px\]{
    min-width: 240px;
  }

  .sm\:grid-cols-3{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sm\:grid-cols-4{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sm\:flex-row{
    flex-direction: row;
  }

  .sm\:items-center{
    align-items: center;
  }

  .sm\:justify-between{
    justify-content: space-between;
  }

  .sm\:gap-3{
    gap: 0.75rem;
  }

  .sm\:gap-4{
    gap: 1rem;
  }

  .sm\:p-4{
    padding: 1rem;
  }

  .sm\:p-6{
    padding: 1.5rem;
  }

  .sm\:px-6{
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .sm\:px-8{
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .sm\:py-3{
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .sm\:py-8{
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .sm\:text-3xl{
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

@media (min-width: 768px){
  .md\:flex-none{
    flex: none;
  }

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

  .md\:grid-cols-4{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .md\:pb-8{
    padding-bottom: 2rem;
  }
}

@media (min-width: 1024px){
  .lg\:hidden{
    display: none;
  }

  .lg\:grid-cols-3{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:p-8{
    padding: 2rem;
  }

  .lg\:px-8{
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .lg\:pb-0{
    padding-bottom: 0px;
  }
}

@media (min-width: 1280px){
  .xl\:grid-cols-4{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1536px){
  .\32xl\:grid-cols-5{
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
