@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:wght@400;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,600&family=IBM+Plex+Mono:wght@400;600&family=Space+Mono:wght@400;700&display=swap");

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

:root {
    --app-header-height: 74px;
    --pinned-area-height: 0px;
    --smart-flow-area-height: 0px;
    --minimum-flow-area-height:
        max(
            104px,
            calc(
                var(--word-font-size, 28px) +
                var(--word-font-size, 28px) +
                var(--word-font-size, 28px) +
                24px
            )
        );

    --page-background: #efe5d5;
    --panel-background: #efe5d5;

    --toolbar-background:
        rgba(239, 229, 213, 0.9);

    --toolbar-hover-background:
        rgba(239, 229, 213, 0.98);

    --surface-soft:
        rgba(255, 255, 255, 0.22);

    --surface-medium:
        rgba(255, 255, 255, 0.34);

    --text-color: #1d1d1d;
    --divider-color: rgba(0, 0, 0, 0.08);

    --theme-word-color: #5b3a29;
    --word-font-family:
        "Courier New",
        Courier,
        monospace;

    --control-border-color:
        rgba(0, 0, 0, 0.3);

    --panel-border-color:
        rgba(0, 0, 0, 0.28);

    --interaction-hover-background:
        rgba(0, 0, 0, 0.07);

    --danger-color: #8a2525;

    --danger-border-color:
        rgba(138, 37, 37, 0.55);

    --danger-hover-background:
        rgba(138, 37, 37, 0.08);

    --toast-success-color: #2f7d4a;
    --toast-info-color: #356fa8;
    --toast-warning-color: #9a6100;
}

html[data-theme="sand"] {
    --page-background: #efe5d5;
    --panel-background: #efe5d5;

    --toolbar-background:
        rgba(239, 229, 213, 0.9);

    --toolbar-hover-background:
        rgba(239, 229, 213, 0.98);

    --surface-soft:
        rgba(255, 255, 255, 0.22);

    --surface-medium:
        rgba(255, 255, 255, 0.34);

    --text-color: #5b3a29;
    --theme-word-color: #5b3a29;

    --divider-color:
        rgba(91, 58, 41, 0.1);
}

html[data-theme="sage"] {
    --page-background: #dfe5d6;
    --panel-background: #e5eadf;

    --toolbar-background:
        rgba(229, 234, 223, 0.9);

    --toolbar-hover-background:
        rgba(229, 234, 223, 0.98);

    --surface-soft:
        rgba(255, 255, 255, 0.22);

    --surface-medium:
        rgba(255, 255, 255, 0.34);

    --text-color: #24543d;
    --theme-word-color: #24543d;

    --divider-color:
        rgba(36, 84, 61, 0.1);
}

html[data-theme="lavender"] {
    --page-background: #e7e0ed;
    --panel-background: #ece6f1;

    --toolbar-background:
        rgba(236, 230, 241, 0.9);

    --toolbar-hover-background:
        rgba(236, 230, 241, 0.98);

    --surface-soft:
        rgba(255, 255, 255, 0.22);

    --surface-medium:
        rgba(255, 255, 255, 0.34);

    --text-color: #5b3a78;
    --theme-word-color: #5b3a78;

    --divider-color:
        rgba(91, 58, 120, 0.1);
}

html[data-theme="rose"] {
    --page-background: #eededc;
    --panel-background: #f1e4e2;

    --toolbar-background:
        rgba(241, 228, 226, 0.9);

    --toolbar-hover-background:
        rgba(241, 228, 226, 0.98);

    --surface-soft:
        rgba(255, 255, 255, 0.22);

    --surface-medium:
        rgba(255, 255, 255, 0.34);

    --text-color: #7a3346;
    --theme-word-color: #7a3346;

    --divider-color:
        rgba(122, 51, 70, 0.1);
}

html[data-theme="night"] {
    color-scheme: dark;

    --page-background: #121416;
    --panel-background: #1b1e21;

    --toolbar-background:
        rgba(27, 30, 33, 0.94);

    --toolbar-hover-background:
        rgba(42, 46, 50, 0.98);

    --surface-soft: #292d31;
    --surface-medium: #34393e;

    --text-color: #f1eee8;
    --theme-word-color: #f7f2e8;

    --divider-color:
        rgba(241, 238, 232, 0.12);

    --control-border-color:
        rgba(241, 238, 232, 0.28);

    --panel-border-color:
        rgba(241, 238, 232, 0.24);

    --interaction-hover-background:
        rgba(241, 238, 232, 0.08);

    --danger-color: #ff9a9a;
    --danger-border-color:
        rgba(255, 154, 154, 0.58);

    --danger-hover-background:
        rgba(255, 154, 154, 0.12);
}

html[data-theme="terminal"] {
    color-scheme: dark;

    --page-background: #000000;
    --panel-background: #000000;

    --toolbar-background:
        rgba(0, 0, 0, 0.96);

    --toolbar-hover-background:
        rgba(0, 24, 0, 0.98);

    --surface-soft: #001400;
    --surface-medium: #002000;

    --text-color: #20ff04;
    --theme-word-color: #20ff04;

    --divider-color:
        rgba(32, 255, 4, 0.18);

    --control-border-color:
        rgba(32, 255, 4, 0.42);

    --panel-border-color:
        rgba(32, 255, 4, 0.32);

    --interaction-hover-background:
        rgba(32, 255, 4, 0.1);

    --danger-color: #ff7c7c;
    --danger-border-color:
        rgba(255, 124, 124, 0.58);

    --danger-hover-background:
        rgba(255, 124, 124, 0.12);
}

html[data-theme="midnight"] {
    color-scheme: dark;

    --page-background: #09142b;
    --panel-background: #101f3d;

    --toolbar-background:
        rgba(16, 31, 61, 0.95);

    --toolbar-hover-background:
        rgba(28, 50, 91, 0.98);

    --surface-soft: #182b50;
    --surface-medium: #213861;

    --text-color: #dbe8ff;
    --theme-word-color: #8fc8ff;

    --divider-color:
        rgba(143, 200, 255, 0.18);

    --control-border-color:
        rgba(219, 232, 255, 0.3);

    --panel-border-color:
        rgba(143, 200, 255, 0.25);

    --interaction-hover-background:
        rgba(143, 200, 255, 0.1);

    --danger-color: #ff9a9a;
    --danger-border-color:
        rgba(255, 154, 154, 0.58);

    --danger-hover-background:
        rgba(255, 154, 154, 0.12);
}

html[data-theme="sepia"] {
    color-scheme: dark;

    --page-background: #2a2017;
    --panel-background: #37291d;

    --toolbar-background:
        rgba(55, 41, 29, 0.95);

    --toolbar-hover-background:
        rgba(75, 56, 39, 0.98);

    --surface-soft: #493724;
    --surface-medium: #5b452e;

    --text-color: #f0dfc2;
    --theme-word-color: #f5d79b;

    --divider-color:
        rgba(245, 215, 155, 0.18);

    --control-border-color:
        rgba(240, 223, 194, 0.3);

    --panel-border-color:
        rgba(245, 215, 155, 0.25);

    --interaction-hover-background:
        rgba(245, 215, 155, 0.1);

    --danger-color: #ffaaa0;
    --danger-border-color:
        rgba(255, 170, 160, 0.58);

    --danger-hover-background:
        rgba(255, 170, 160, 0.12);
}

html[data-theme="night"],
html[data-theme="terminal"],
html[data-theme="midnight"],
html[data-theme="sepia"] {
    --toast-success-color: #8ce6aa;
    --toast-info-color: #8fc8ff;
    --toast-warning-color: #ffd27a;
}

body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height:
        var(
            --app-viewport-height,
            100dvh
        );

    overflow: hidden;

    background: var(--page-background);
    color: var(--text-color);

    font-family:
    var(
        --word-font-family,
        "Courier New",
        Courier,
        monospace
    );
}

#app-loading-status {
    position: fixed;
    inset: 0;
    z-index: 400;

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

    gap: 18px;
    padding: 28px;

    background: var(--page-background);
    color: var(--text-color);

    text-align: center;

    transition:
        opacity 220ms ease,
        visibility 220ms ease;
}

#app-loading-status[hidden] {
    display: none;
}

#app-loading-status.is-ready {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loading-mark {
    display: grid;
    place-items: center;

    width: 76px;
    height: 76px;

    background: var(--surface-medium);

    border:
        1px solid
        var(--divider-color);

    border-radius: 24px;

    color: var(--theme-word-color);

    box-shadow:
        0 14px 34px
        rgba(0, 0, 0, 0.09);

    animation:
        loading-mark-breathe
        1.5s ease-in-out
        infinite;
}

.app-loading-mark svg {
    width: 60px;
    height: 60px;

    overflow: visible;
}

.app-loading-mark .brand-mark-shape,
.app-brand-symbol .brand-mark-shape {
    fill: currentColor;
}

.app-loading-copy {
    display: grid;
    gap: 7px;
}

.app-loading-copy strong {
    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 24px;
    font-weight: 600;
}

.app-loading-copy span {
    max-width: 360px;

    font-size: 15px;
    line-height: 1.45;

    opacity: 0.68;
}

#app-loading-retry-button {
    min-height: 44px;
    padding: 9px 18px;

    background: transparent;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;

    cursor: pointer;
}

#app-loading-retry-button:hover {
    background:
        var(--interaction-hover-background);
}

#app-loading-status.is-error
.app-loading-mark {
    animation: none;
}

@keyframes loading-mark-breathe {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.045);
    }
}

@media (prefers-reduced-motion: reduce) {
    #app-loading-status,
    .app-loading-mark,
    .how-to-use-progress-dot {
        animation: none;
        transition: none;
    }
}

#background {
    position: relative;

    width: 100%;
    height:
        calc(
            100% -
            var(--app-header-height) -
            var(--pinned-area-height) -
            var(--smart-flow-area-height)
        );

    margin-top:
        calc(
            var(--app-header-height) +
            var(--pinned-area-height) +
            var(--smart-flow-area-height)
        );

    display: block;
}

#app-main {
    width: 100%;
    height: 100%;
}

#ribbon-container{

    width:100%;
    height:100%;

    position:relative;
}

.ribbon{

    position:absolute;

    left:0;

    width:100%;

    border-top: 1px solid var(--divider-color);
    border-bottom: 1px solid var(--divider-color);

    display:flex;
    align-items:center;

    overflow: hidden;
}

.word {
    position: absolute;

    left: 0;
    top: 50%;

    white-space: nowrap;

    cursor: pointer;
    user-select: none;
    touch-action: manipulation;

    color:
        var(
            --word-color,
            var(
                --theme-word-color,
                var(--text-color)
            )
        );

    font-family:
        var(
            --word-font-family,
            "Courier New",
            Courier,
            monospace
        );

    font-size: var(--word-font-size, 28px);
}

.word-label {
    display: inline-block;

    transform: scale(1);
    transform-origin: center;

    transition: transform 0.18s ease;
}

.flowing-word-pin-button {
    position: absolute;

    top: 50%;
    right: 0;
    z-index: 2;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;
    padding: 0;

    border: 0;
    border-radius: 0;
    background: transparent;

    color:
        var(
            --word-color,
            var(
                --theme-word-color,
                var(--text-color)
            )
        );
    
    font-size: 14px;
    line-height: 1;

    cursor: pointer;

    opacity: 0;

    transform:
        translate(132%, -50%)
        scale(0.9);

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.flowing-word-pin-icon {
    display: block;

    width: 27px;
    height: 27px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    transform: rotate(40deg);
    transform-origin: center;

    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .word:hover
    .flowing-word-pin-button:not([hidden]) {
        opacity: 1;

        transform:
            translate(132%, -50%)
            scale(1);
    }

    .word:hover .word-label {
        transform: scale(1.12);
    }
}

.flowing-word-pin-button[hidden] {
    display: none;
}

.word:focus {
    outline: none;
}

.word:focus-visible .word-label {
    transform: scale(1.12);

    outline: 2px solid currentColor;
    outline-offset: 5px;

    border-radius: 3px;
}

@media (hover: none), (pointer: coarse) {
    .word:active .word-label {
        transform: scale(1.08);
        opacity: 0.72;
    }
}

#app-header {
    position: absolute;

    top: 0;

    right: 0;
    left: 0;

    z-index: 50;

    height:
        var(--app-header-height);

    display: flex;
    align-items: center;

    padding-left:
        calc(
            20px +
            env(safe-area-inset-left)
        );

    padding-right:
        calc(
            20px +
            env(safe-area-inset-right)
        );

    background:
        var(--toolbar-background);

    border-bottom:
        1px solid
        var(--divider-color);

    box-shadow:
        0 4px 18px
        rgba(0, 0, 0, 0.07);

    backdrop-filter: blur(12px);
}

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;

    overflow: hidden !important;

    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;

    border: 0 !important;
    white-space: nowrap !important;
}

#pinned-words-strip {
    position: absolute;

    top: var(--app-header-height);

    right: 0;
    left: 0;

    z-index: 45;

    max-height:
        calc(
            100dvh -
            var(--app-header-height) -
            var(--smart-flow-area-height) -
            var(--minimum-flow-area-height)
        );

    padding: 11px 20px 12px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background:
        var(--toolbar-background);

    border-bottom:
        1px solid
        var(--divider-color);

    box-shadow:
        0 7px 18px
        rgba(0, 0, 0, 0.07);

    backdrop-filter: blur(12px);
    -webkit-overflow-scrolling: touch;
}

#pinned-words-strip[hidden] {
    display: none;
}

#local-smart-flow-bar {
    position: absolute;

    top:
        calc(
            var(--app-header-height) +
            var(--pinned-area-height)
        );
    right: 0;
    left: 0;

    z-index: 44;

    min-height: 54px;
    padding:
        8px
        calc(
            20px +
            env(safe-area-inset-right)
        )
        8px
        calc(
            20px +
            env(safe-area-inset-left)
        );

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

    gap: 14px;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 10%,
            var(--toolbar-background)
        );

    border-bottom:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 34%,
            var(--divider-color)
        );

    box-shadow:
        0 7px 18px
        rgba(0, 0, 0, 0.07);

    backdrop-filter: blur(12px);
}

#local-smart-flow-bar[hidden] {
    display: none;
}

.local-smart-flow-copy {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 10px;
}

.local-smart-flow-copy > div {
    min-width: 0;

    display: grid;
    gap: 2px;
}

.local-smart-flow-copy strong,
.local-smart-flow-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.local-smart-flow-copy strong {
    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 15px;
    font-weight: 650;
}

.local-smart-flow-copy
#local-smart-flow-meta {
    color: var(--theme-word-color);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.local-smart-flow-icon {
    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    background: var(--surface-medium);
    border:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 34%,
            var(--divider-color)
        );
    border-radius: 50%;

    color: var(--theme-word-color);
    font-size: 23px;
    line-height: 1;
}

.local-smart-flow-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 7px;
}

.local-smart-flow-actions button {
    min-height: 36px;
    padding: 7px 12px;

    background: transparent;
    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 11px;
    font-weight: 650;

    cursor: pointer;
}

.local-smart-flow-actions button:hover,
.local-smart-flow-actions button:focus-visible {
    background:
        var(
            --interaction-hover-background
        );
}

.local-smart-flow-actions
button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (max-width: 520px) {
    #local-smart-flow-bar {
        align-items: stretch;
        flex-direction: column;

        gap: 7px;
        padding:
            8px
            calc(
                12px +
                env(safe-area-inset-right)
            )
            9px
            calc(
                12px +
                env(safe-area-inset-left)
            );
    }

    .local-smart-flow-actions {
        width: 100%;
    }

    .local-smart-flow-actions button {
        flex: 1 1 0;
    }
}

.pinned-words-strip-inner {
    display: flex;
    align-items: flex-start;

    gap: 14px;
}

.pinned-words-heading {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 5px;
    padding-top: 6px;

    font-size: 13px;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    opacity: 0.64;
}

.pinned-words-heading-icon {
    display: block;
    flex: 0 0 auto;

    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    transform: rotate(40deg);
    transform-origin: center;

    pointer-events: none;
}

.pinned-words-count {
    font-variant-numeric:
        tabular-nums;
}

.pinned-words-list {
    flex: 1 1 auto;

    display: flex;
    align-items: center;
    flex-wrap: wrap;

    min-width: 0;
    gap: 7px 9px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.pinned-word-item {
    position: relative;

    display: inline-flex;
    align-items: center;

    max-width: 100%;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color:
        var(
            --word-color,
            var(--theme-word-color)
        );

    cursor: grab;
    user-select: none;
}

.pinned-word-item:active {
    cursor: grabbing;
}

.pinned-word-item:hover {
    background:
        var(--surface-medium);
}

.pinned-word-item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.pinned-word-item.is-dragging {
    opacity: 0.42;
}

.pinned-word-item.is-drop-before::before,
.pinned-word-item.is-drop-after::after {
    position: absolute;

    top: 4px;
    bottom: 4px;

    width: 3px;

    background: currentColor;
    border-radius: 999px;

    content: "";
}

.pinned-word-item.is-drop-before::before {
    left: -6px;
}

.pinned-word-item.is-drop-after::after {
    right: -6px;
}

.pinned-word-label {
    min-width: 0;

    padding: 6px 5px 6px 12px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-family:
        var(--word-font-family);

    font-size:
        clamp(
            17px,
            calc(
                var(--word-font-size, 28px) -
                6px
            ),
            24px
        );

    line-height: 1.15;
}

.pinned-word-remove-button {
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    width: 29px;
    height: 29px;
    margin-right: 3px;
    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 50%;

    color: inherit;
    font: inherit;
    font-size: 20px;
    line-height: 1;

    cursor: pointer;
    opacity: 0.68;
}

.pinned-word-remove-button:hover,
.pinned-word-remove-button:focus-visible {
    background:
        var(--interaction-hover-background);

    opacity: 1;
}

.pinned-word-remove-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

@media (max-width: 700px) {
    #pinned-words-strip {
        max-height:
            calc(
                100dvh -
                var(--app-header-height) -
                var(--minimum-flow-area-height)
            );

        padding:
            9px
            12px
            11px;
    }

    .pinned-words-strip-inner {
        display: grid;
        gap: 7px;
    }

    .pinned-words-heading {
        padding-top: 0;
    }

    .pinned-words-list {
        gap: 7px;
    }
}

#app-toolbar {
    position: relative;

    width: 100%;

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

    gap: 9px;
}

#app-brand {
    display: flex;
    align-items: center;

    gap: 8px;

    min-width: 0;
    margin-right: auto;

    color: var(--theme-word-color);

    font-family:
        "Fraunces",
        Georgia,
        serif;
    line-height: 1;

    user-select: none;
}

.app-brand-symbol {
    flex: 0 0 auto;

    width: 35px;
    height: 35px;

    overflow: visible;
}

.app-brand-full {
    font-size: 23px;
    font-weight: 400;
    letter-spacing: -0.025em;
}

#toolbar-actions {
    position: relative;

    display: flex;
    align-items: center;

    gap: 8px;
}

#toolbar-primary-actions {
    display: flex;
    align-items: center;

    gap: 8px;
}

#toolbar-menu-panel {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    z-index: 55;

    width:
        min(
            310px,
            calc(100vw - 40px)
        );

    max-height:
        calc(
            100dvh -
            var(--app-header-height) -
            16px
        );

    padding: 9px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 16px;

    box-shadow:
        0 18px 44px
        rgba(0, 0, 0, 0.2);

    backdrop-filter: blur(16px);
    -webkit-overflow-scrolling: touch;
}

#toolbar-menu-panel[hidden] {
    display: none;
}

#toolbar-menu-panel.is-open {
    display: grid;
    gap: 9px;
}

.toolbar-menu-section {
    display: grid;
    gap: 4px;
}

.toolbar-menu-section[hidden] {
    display: none;
}

.toolbar-menu-section +
.toolbar-menu-section {
    padding-top: 9px;

    border-top:
        1px solid
        var(--divider-color);
}

.toolbar-menu-section-label {
    padding: 2px 11px 4px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.58;
}

.toolbar-menu-section-actions {
    display: grid;
    gap: 3px;
}

#toolbar-menu-panel .toolbar-button {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 44px;

    padding: 9px 11px;
    justify-content: flex-start;

    background: transparent;
    border-color: transparent;
    border-radius: 10px;

    box-shadow: none;
    backdrop-filter: none;
}

#toolbar-menu-panel
.toolbar-icon-button,
#toolbar-menu-panel
.toolbar-menu-row {
    gap: 10px;
}

#toolbar-menu-panel
.toolbar-icon-button
.toolbar-button-label,
#toolbar-menu-panel
.toolbar-menu-row
.toolbar-button-label {
    display: inline;
}

#toolbar-menu-panel .toolbar-button:hover,
#toolbar-menu-panel .toolbar-button:focus-visible {
    background:
        var(--surface-medium);
}

.toolbar-menu-link {
    text-decoration: none;
}

.toolbar-menu-row-detail {
    min-width: 0;
    margin-left: auto;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
    opacity: 0.7;
}

.toolbar-menu-chevron {
    flex: 0 0 auto;

    font-size: 16px;
    opacity: 0.65;

    transition:
        transform 160ms ease;
}

#toolbar-language-button[
    aria-expanded="true"
] .toolbar-menu-chevron {
    transform: rotate(180deg);
}

.toolbar-language-options {
    display: grid;
    gap: 3px;

    margin: 2px 5px 5px 39px;
    padding: 6px;

    background:
        color-mix(
            in srgb,
            var(--surface-medium) 70%,
            transparent
        );

    border-radius: 10px;
}

.toolbar-language-options[hidden] {
    display: none;
}

.toolbar-language-option {
    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 7px 9px;

    background: transparent;
    border: 0;
    border-radius: 8px;

    color: inherit;
    font: inherit;
    font-size: 14px;
    text-align: left;

    cursor: pointer;
}

.toolbar-language-option:hover,
.toolbar-language-option:focus-visible {
    background:
        var(--toolbar-hover-background);
}

.toolbar-language-option.is-active::before {
    content: "✓";

    width: 16px;
    margin-right: -2px;

    font-weight: 700;
}

.toolbar-language-option:not(
    .is-active
)::before {
    content: "";

    width: 16px;
    margin-right: -2px;
}

.toolbar-language-option:disabled {
    cursor: default;
    opacity: 0.58;
}

.toolbar-language-soon {
    margin-left: auto;

    padding: 3px 7px;

    background:
        var(--toolbar-background);

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.toolbar-language-help {
    margin: 4px 7px 2px 25px;

    font-size: 11px;
    line-height: 1.35;
    opacity: 0.62;
}

.toolbar-button {
    display: flex;
    align-items: center;

    padding: 9px 14px;

    background:
        var(--toolbar-background);

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 17px;

    cursor: pointer;

    box-shadow:
        0 4px 18px
        rgba(0, 0, 0, 0.1);

    backdrop-filter: blur(8px);
}

.toolbar-button:hover {
    background:
        var(--toolbar-hover-background);
}

.toolbar-button:active,
.how-to-use-button:active,
.settings-secondary-button:active,
.about-privacy-footer a:active {
    filter: brightness(0.94);
}

.toolbar-button:focus-visible {
    outline:
        2px solid currentColor;

    outline-offset: 3px;
}

.toolbar-lists-button {
    gap: 9px;
    min-height: 44px;
}

.toolbar-icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;

    padding: 0;
    justify-content: center;
}

.toolbar-icon-button
.toolbar-button-label {
    display: none;
}

.toolbar-button-detail {
    padding-left: 9px;

    border-left:
        1px solid
        var(--control-border-color);

    font-size: 14px;
    opacity: 0.7;
}

#animation-toggle-button {
    width: 44px;
    min-width: 44px;
    height: 44px;

    padding: 0;
    justify-content: center;
}

.toolbar-icon,
.animation-toggle-icon {
    display: block;
    flex: 0 0 auto;

    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;

    pointer-events: none;
}

#mobile-menu-button {
    display: flex;

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

    padding: 0;

    justify-content: center;

    line-height: 1;
}

    @media
        (max-width: 700px),
        (orientation: landscape)
        and (max-height: 600px) {
    :root {
        --app-header-height: 64px;
    }

    #app-header {
        padding-left:
            calc(
                12px +
                env(safe-area-inset-left)
            );

        padding-right:
            calc(
                12px +
                env(safe-area-inset-right)
            );
    }

    .app-brand-full {
        display: none;
    }

    .app-brand-symbol {
        width: 34px;
        height: 34px;
    }

    #toolbar-menu-panel {
        width:
            min(
                310px,
                calc(100vw - 24px)
            );
    }

    #toolbar-menu-primary-actions
    .toolbar-lists-button {
        min-width: 0;
        overflow: hidden;
    }

    #toolbar-menu-primary-actions
    .toolbar-button-label {
        flex: 0 0 auto;
    }

    #toolbar-menu-primary-actions
    .toolbar-button-detail {
        flex: 1 1 auto;
        min-width: 0;

        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;

        margin-left: 0;
        padding-right: 10px;

        overflow: hidden;
        white-space: nowrap;

        text-align: right;
    }

    #toolbar-menu-primary-actions
    .toolbar-button-detail-name {
        min-width: 0;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #toolbar-menu-primary-actions
    .toolbar-button-detail-count {
        flex: 0 0 auto;
    }

    #animation-toggle-button {
        position: fixed;

        left: 50%;

        bottom:
            calc(
                16px +
                env(
                    safe-area-inset-bottom
                )
            );

        z-index: 60;

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

        padding: 0;

        justify-content: center;

        transform:
            translateX(-50%);
    }

    #animation-toggle-button
    .animation-toggle-icon {
        width: 20px;
        height: 20px;
    }

    #toast {
        bottom:
            calc(
                76px +
                env(
                    safe-area-inset-bottom
                )
            );
    }
}

#add-word-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.28);
}

#add-word-overlay[hidden] {
    display: none;
}

.add-word-modal {
    width: min(420px, 100%);

    padding: 28px;

    background: var(--panel-background, #efe5d5);
    border: 1px solid var(--panel-border-color);
    border-radius: 16px;

    text-align: center;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.add-word-modal h2 {
    margin-bottom: 18px;
    font-size: 23px;
    font-weight: normal;
}

#pending-word {
    margin-bottom: 22px;

    color:
        var(
            --word-color,
            var(--theme-word-color)
        );

    font-family:
        var(--word-font-family);

    font-size: 34px;
}

.word-long-press-hint {
    display: none;
}

@media (hover: none), (pointer: coarse) {
    .word-long-press-hint:not([hidden]) {
        display: block;

        margin: -12px 0 20px;

        font-size: 14px;
        line-height: 1.4;
        opacity: 0.65;
    }
}

.confirmation-preference {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 24px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.modal-actions button {
    min-width: 100px;
    padding: 10px 18px;

    font: inherit;
    font-size: 17px;

    background: transparent;
    border: 1px solid var(--control-border-color);
    border-radius: 999px;

    cursor: pointer;
}

.modal-actions button:hover {
    background: var(--interaction-hover-background);
}

#toast {
    --toast-accent:
        var(--toast-info-color);

    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 240;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;

    width: max-content;
    max-width:
        min(
            470px,
            calc(100vw - 28px)
        );

    gap: 11px;
    padding: 12px 16px 12px 12px;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-left:
        5px solid
        var(--toast-accent);

    border-radius: 13px;

    color: var(--text-color);

    box-shadow:
        0 18px 48px
        rgba(0, 0, 0, 0.28),
        0 0 0 1px
        var(--divider-color);

    backdrop-filter: blur(12px);

    opacity: 0;
    pointer-events: none;

    transform:
        translate(-50%, 18px)
        scale(0.97);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

#toast[data-type="success"] {
    --toast-accent:
        var(--toast-success-color);
}

#toast[data-type="info"] {
    --toast-accent:
        var(--toast-info-color);
}

#toast[data-type="warning"] {
    --toast-accent:
        var(--toast-warning-color);
}

#toast[data-type="error"] {
    --toast-accent:
        var(--danger-color);
}

.toast-icon {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    flex: 0 0 auto;

    background:
        var(--surface-medium);

    border:
        1px solid
        var(--toast-accent);

    border-radius: 50%;

    color:
        var(--toast-accent);

    font-family:
        "Courier New",
        monospace;

    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.toast-message {
    min-width: 0;

    overflow-wrap: anywhere;

    font-size: 15px;
    line-height: 1.4;
}

.toast-action-button {
    align-self: center;

    padding: 7px 12px;

    background:
        var(--surface-medium);

    border:
        1px solid
        var(--toast-accent);

    border-radius: 999px;

    color:
        var(--toast-accent);

    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;

    cursor: pointer;
}

.toast-action-button:hover,
.toast-action-button:focus-visible {
    background:
        var(--interaction-hover-background);
}

.toast-action-button:focus-visible {
    outline:
        2px solid
        var(--toast-accent);

    outline-offset: 3px;
}

.toast-action-button[hidden] {
    display: none;
}

#toast.has-action.is-visible {
    pointer-events: auto;
}

#toast.is-visible {
    opacity: 1;

    transform:
        translate(-50%, 0)
        scale(1);
}

@media (max-width: 480px) {
    #toast.has-action {
        grid-template-columns:
            auto
            minmax(0, 1fr);
    }

    #toast.has-action
    .toast-action-button {
        grid-column: 2;

        justify-self: start;
    }
}

#selected-words-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.28);
}

#selected-words-overlay[hidden] {
    display: none;
}

.selected-words-panel {
    width: min(620px, 100%);
    max-height: min(680px, 82vh);

    padding: 26px;

    overflow-y: auto;

    background: var(--panel-background, #efe5d5);
    border: 1px solid var(--panel-border-color);
    border-radius: 16px;

    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.selected-words-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 22px;
}

.selected-words-header h2 {
    font-size: 26px;
    font-weight: normal;
}

.panel-close-button,
.remove-selected-word {
    display: grid;
    place-items: center;

    padding: 0;

    background: transparent;
    border: 1px solid var(--control-border-color);
    border-radius: 50%;

    color: inherit;
    font: inherit;

    cursor: pointer;
}

.panel-close-button {
    width: 36px;
    height: 36px;

    flex: 0 0 auto;

    font-size: 25px;
}

.selected-words-list {
    display: grid;
    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.selected-words-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 12px 14px;

    border: 1px solid var(--divider-color);
    border-radius: 10px;

    font-size: 22px;
}

.remove-selected-word {
    width: 30px;
    height: 30px;

    flex: 0 0 auto;

    font-size: 21px;
}

.panel-close-button:hover,
.remove-selected-word:hover {
    background: var(--interaction-hover-background);
}

.selected-words-empty {
    padding: 26px 0;

    text-align: center;
    font-size: 20px;

    opacity: 0.7;
}

.word-list-toolbar {
    margin-bottom: 18px;
}

.word-list-toolbar > label {
    display: block;

    margin-bottom: 7px;

    font-size: 16px;
    opacity: 0.72;
}

.word-list-actions {
    display: flex;
    gap: 10px;
}

#word-list-select,
#word-list-sort-select {
    min-width: 0;

    padding: 10px 12px;

    background: var(--surface-medium);
    border: 1px solid var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 17px;

    cursor: pointer;
}

#word-list-select {
    flex: 1;
}

.word-list-sort-control {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.word-list-sort-control label {
    display: flex;
    align-items: center;

    gap: 7px;

    font-size: 15px;
    opacity: 0.72;
}

.word-list-sort-icon {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#word-list-sort-select {
    width: 100%;
}

.word-list-search-control {
    margin-top: 14px;
}

.word-list-search-control > label {
    display: block;

    margin-bottom: 7px;

    font-size: 15px;
    opacity: 0.72;
}

.word-list-search-field {
    position: relative;
}

.word-list-search-icon {
    position: absolute;
    top: 50%;
    left: 13px;

    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    opacity: 0.62;
    pointer-events: none;
    transform: translateY(-50%);
}

#word-list-search-input {
    width: 100%;

    padding: 10px 38px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 17px;
}

#word-list-search-input:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.word-list-search-summary {
    min-height: 18px;

    margin-top: 6px;

    font-size: 13px;
    text-align: right;
    opacity: 0.62;
}

#show-create-list-button,
.create-list-actions button {
    padding: 10px 15px;

    background: transparent;
    border: 1px solid var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 16px;

    cursor: pointer;
}

#show-create-list-button,
#show-create-note-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;
}

.create-action-icon {
    width: 19px;
    height: 19px;

    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#show-create-list-button:hover,
.create-list-actions button:hover {
    background: var(--interaction-hover-background);
}

.create-list-form {
    margin-bottom: 20px;
    padding: 14px;

    background: var(--surface-soft);
    border: 1px solid var(--divider-color);
    border-radius: 11px;
}

.create-list-form[hidden] {
    display: none;
}

#new-list-name {
    width: 100%;

    margin-bottom: 11px;
    padding: 10px 12px;

    background: var(--surface-medium);
    border: 1px solid var(--control-border-color);
    border-radius: 8px;

    color: inherit;
    font: inherit;
    font-size: 17px;
}

.create-list-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.create-list-error {
    min-height: 18px;

    margin-top: 8px;

    font-size: 14px;
    color: var(--danger-color);
}

@media (max-width: 520px) {
    .word-list-actions {
        align-items: stretch;
        flex-direction: column;
    }

    #show-create-list-button {
        align-self: flex-end;
    }

}

#search-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.28);
}

#search-overlay[hidden] {
    display: none;
}

.search-panel {
    width: min(540px, 100%);
    max-height: min(680px, 82vh);

    padding: 26px;

    overflow-y: auto;

    background: var(--panel-background, #efe5d5);
    border: 1px solid var(--panel-border-color);
    border-radius: 16px;

    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 22px;
}

.search-panel-header h2 {
    font-size: 26px;
    font-weight: normal;
}

.search-label {
    display: block;

    margin-bottom: 7px;

    font-size: 16px;
    opacity: 0.72;
}

#saved-word-search {
    width: 100%;

    padding: 12px 42px;

    background: var(--surface-medium);
    border: 1px solid var(--control-border-color);
    border-radius: 10px;

    color: inherit;
    font: inherit;
    font-size: 19px;
}

.search-input-field {
    position: relative;
}

.search-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;

    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    opacity: 0.62;
    pointer-events: none;
    transform: translateY(-50%);
}

.search-match-control {
    display: grid;
    gap: 7px;

    margin-top: 12px;
}

.search-match-control label {
    font-size: 15px;
    opacity: 0.72;
}

.search-match-control select {
    width: 100%;
    min-width: 0;

    padding: 10px 12px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 16px;

    cursor: pointer;
}

.search-match-control
select:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.search-result-summary {
    min-height: 20px;

    margin: 14px 0 10px;

    font-size: 15px;
    opacity: 0.68;
}

.search-results-list {
    display: grid;
    gap: 9px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.search-results-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 12px 14px;

    border: 1px solid var(--divider-color);
    border-radius: 10px;
}

.search-result-word {
    font-size: 22px;
}

.search-result-list-name {
    font-size: 14px;
    opacity: 0.65;
}

.search-empty-message {
    padding: 28px 8px;

    text-align: center;
    font-size: 18px;
    opacity: 0.68;
}

#settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.28);
}

#settings-overlay[hidden] {
    display: none;
}

.settings-panel {
    width: min(500px, 100%);

    max-height: calc(100vh - 48px);
    padding: 26px;

    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;

    background: var(
        --panel-background,
        #efe5d5
    );

    border: 1px solid var(--panel-border-color);
    border-radius: 16px;

    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.22);
}

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 28px;
}

.settings-panel-header h2 {
    font-size: 26px;
    font-weight: normal;
}

.settings-category {
    overflow: hidden;

    border: 1px solid var(--control-border-color);
    border-radius: 13px;
}

.settings-category + .settings-category {
    margin-top: 10px;
}

.settings-category > summary {
    position: relative;

    display: grid;
    gap: 4px;

    padding: 14px 46px 14px 15px;

    cursor: pointer;
    list-style: none;
    user-select: none;
}

.settings-category > summary::-webkit-details-marker {
    display: none;
}

.settings-category > summary::after {
    content: "+";

    position: absolute;
    top: 50%;
    right: 15px;

    transform: translateY(-50%);

    font-size: 22px;
    line-height: 1;
    opacity: 0.62;
}

.settings-category[open] > summary::after {
    content: "−";
}

.settings-category > summary > span {
    font-size: 18px;
    line-height: 1.25;
}

.settings-category > summary > small {
    font-size: 13px;
    line-height: 1.35;
    opacity: 0.62;
}

.settings-category > summary:hover {
    background: var(--interaction-hover-background);
}

.settings-category > summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}

.settings-category[open] > summary {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--divider-color);
}

.settings-category-body {
    padding: 16px;
}

.settings-category-body > :last-child {
    margin-bottom: 0;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
    margin-bottom: 10px;
}

.settings-label-row label {
    font-size: 18px;
}

.settings-label-row output {
    font-size: 15px;
    opacity: 0.65;
}

.settings-group input[type="range"] {
    width: 100%;
    cursor: pointer;
}

input[type="range"],
input[type="checkbox"],
input[type="radio"] {
    accent-color:
        var(
            --word-color,
            var(
                --theme-word-color,
                var(--text-color)
            )
        );
}

input[type="range"]:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline:
        2px solid
        var(
            --word-color,
            var(
                --theme-word-color,
                var(--text-color)
            )
        );

    outline-offset: 3px;
}

.settings-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 17px;
    cursor: pointer;
}

.notification-sounds-row {
    margin-top: 14px;
}

.notification-sounds-help {
    margin:
        7px
        0
        0
        28px;
}

.settings-divider {
    height: 1px;

    margin: 24px 0;

    background: var(--divider-color);
}

.settings-secondary-button {
    width: 100%;

    padding: 11px 16px;

    background: transparent;
    border: 1px solid var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 16px;

    cursor: pointer;
}

.settings-secondary-button:hover {
    background: var(--interaction-hover-background);
}

.settings-reset-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;

    padding: 10px 13px;

    background: var(--surface-medium);
    border-color: var(--divider-color);
    border-radius: 12px;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
}

.settings-reset-action:hover {
    background: var(--interaction-hover-background);
    border-color: var(--control-border-color);
}

.settings-reset-action-icon {
    width: 20px;
    height: 20px;

    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html.hide-ribbon-dividers .ribbon {
    border-top-color: transparent;
    border-bottom-color: transparent;
}

.settings-select-label {
    display: block;

    margin-bottom: 9px;

    font-size: 18px;
}

#theme-select,
#word-font-family,
#word-color-mode {
    width: 100%;

    padding: 10px 12px;

    background: var(--surface-medium);
    border: 1px solid var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 17px;

    cursor: pointer;
}

.settings-button-stack {
    display: grid;
    gap: 10px;
}

.word-list-management-actions {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;

    margin-top: 10px;
}

.word-list-management-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    padding: 8px 13px;

    background: transparent;
    border: 1px solid var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 15px;
    white-space: nowrap;

    cursor: pointer;
}

#show-create-list-button {
    font-size: 15px;
}

.word-list-management-actions button:hover:not(:disabled) {
    background: var(--interaction-hover-background);
}

.word-list-management-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.word-list-management-actions .danger-button {
    border-color: var(--danger-border-color);
    color: var(--danger-color);
}

.settings-danger-zone {
    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid var(--divider-color);
}

.settings-danger-zone h3 {
    margin-bottom: 7px;

    font-size: 18px;
    font-weight: normal;
}

.settings-danger-zone p {
    margin-bottom: 14px;

    font-size: 15px;
    line-height: 1.4;
    opacity: 0.7;
}

.settings-danger-button {
    width: 100%;

    padding: 11px 16px;

    background: transparent;
    border: 1px solid var(--danger-border-color);
    border-radius: 999px;

    color: var(--danger-color);
    font: inherit;
    font-size: 16px;

    cursor: pointer;
}

.settings-danger-button:hover {
    background: var(--danger-hover-background);
}

.settings-backup-zone {
    margin-top: 26px;
    padding-top: 22px;

    border-top: 1px solid var(--divider-color);
}

.settings-backup-zone h3 {
    margin-bottom: 7px;

    font-size: 18px;
    font-weight: normal;
}

.settings-backup-zone p {
    margin-bottom: 14px;

    font-size: 15px;
    line-height: 1.4;
    opacity: 0.7;
}

.settings-backup-actions {
    display: grid;
    gap: 10px;
}

/*
 * Büyük panellerin kaydırma davranışı
 */

.selected-words-panel,
.search-panel,
.settings-panel {
    /*
     * Üst boşluğu başlık oluşturacak.
     * Kaydırılan içerik başlığın altından başlar.
     */
    padding:
        0
        26px
        26px;

    overscroll-behavior-y: none;
    scrollbar-gutter: stable;

    -webkit-overflow-scrolling: touch;
}

/*
 * Sabit panel başlıkları
 */

.selected-words-header,
.search-panel-header,
.settings-panel-header {
    position: sticky;
    top: 0;
    z-index: 4;

    /*
     * Panelin sağ ve sol kenarına kadar uzanır.
     */
    margin:
        0
        -26px
        18px
        -26px;

    padding:
        26px
        26px
        14px
        26px;

    background: var(
        --panel-background,
        #efe5d5
    );

    border-bottom:
        1px solid var(--divider-color);

    border-radius:
        15px
        15px
        0
        0;

    /*
     * içerikten ayıran hafif gölge.
     */
    box-shadow:
        0
        10px
        16px
        -14px
        rgba(0, 0, 0, 0.72);
}

/*
 * Dar veya yüksekliği kısa ekranlar
 */

@media
    (max-width: 600px),
    (max-height: 650px) {

    #selected-words-overlay,
    #search-overlay,
    #settings-overlay {
        padding: 12px;
    }

    .selected-words-panel,
    .search-panel,
    .settings-panel {
        width: 100%;

        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);

        padding:
            0
            18px
            22px;
    }

    .selected-words-header,
    .search-panel-header,
    .settings-panel-header {
        top: 0;

        margin:
            0
            -18px
            14px
            -18px;

        padding:
            22px
            18px
            12px
            18px;
    }

    .selected-words-header h2,
    .search-panel-header h2,
    .settings-panel-header h2 {
        font-size: 23px;
    }

    .selected-words-panel {
        padding:
            0
            10px
            22px;
    }

    .selected-words-header {
        margin:
            0
            -10px
            14px;

        padding:
            22px
            10px
            12px;
    }

    .selected-words-list li,
    .search-results-list li {
        gap: 12px;
    }

    .selected-words-list li > span,
    .search-result-word,
    .search-result-list-name {
        min-width: 0;

        overflow-wrap: anywhere;
    }
}

.keyboard-shortcuts-list {
    display: grid;
    gap: 11px;

    margin: 0;
}

.keyboard-shortcuts-list > div {
    display: grid;
    grid-template-columns: 128px 1fr;
    align-items: center;
    gap: 14px;
}

.keyboard-shortcuts-list dt,
.keyboard-shortcuts-list dd {
    margin: 0;
}

.keyboard-shortcuts-list dt {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyboard-shortcuts-list dd {
    font-size: 15px;
    line-height: 1.35;
    opacity: 0.75;
}

.keyboard-shortcuts-list kbd {
    display: inline-grid;
    place-items: center;

    min-width: 32px;
    min-height: 28px;

    padding: 4px 8px;

    background: var(--surface-medium);
    border: 1px solid var(--control-border-color);
    border-bottom-width: 2px;
    border-radius: 6px;

    color: inherit;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 420px) {
    .keyboard-shortcuts-list > div {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.shortcut-separator {
    align-self: center;

    font-size: 16px;
    opacity: 0.55;
}

/*
 * Görünüm, font ve özel tema ayarları
 */

.custom-theme-editor h3 {
    margin-bottom: 16px;

    font-size: 20px;
    font-weight: normal;
}

.settings-help-text {
    margin-top: 10px;

    font-size: 14px;
    line-height: 1.42;
    opacity: 0.72;
}

.settings-help-text.is-warning {
    color: var(--danger-color);
    opacity: 1;
}

.theme-management-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;
    margin-top: 11px;
}

.theme-management-actions
.settings-secondary-button,
.theme-management-actions
.settings-danger-button {
    min-width: 0;
    height: 100%;
}

.theme-management-actions
button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.custom-word-color-controls {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;

    gap: 10px;
    margin-top: 10px;

    transition: opacity 0.18s ease;
}

.custom-word-color-controls.is-disabled {
    opacity: 0.58;
}

#custom-word-color,
.theme-color-grid input[type="color"] {
    width: 54px;
    height: 42px;

    padding: 3px;

    background: var(--surface-medium);
    border: 1px solid
        var(--control-border-color);
    border-radius: 9px;

    cursor: pointer;
}

#custom-word-color::-webkit-color-swatch-wrapper,
.theme-color-grid
input[type="color"]
::-webkit-color-swatch-wrapper {
    padding: 0;
}

#custom-word-color::-webkit-color-swatch,
.theme-color-grid
input[type="color"]
::-webkit-color-swatch {
    border: 0;
    border-radius: 5px;
}

#custom-word-color::-moz-color-swatch,
.theme-color-grid
input[type="color"]
::-moz-color-swatch {
    border: 0;
    border-radius: 5px;
}

#custom-word-color-text {
    min-width: 0;
    width: 100%;

    padding: 10px 12px;

    background: var(--surface-medium);
    border: 1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-family:
        "Courier New",
        monospace;
    font-size: 16px;
    text-transform: lowercase;
}

.word-color-presets {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;
    margin-top: 11px;
}

.word-color-presets button {
    width: 31px;
    height: 31px;

    padding: 0;

    background:
        var(--preset-color);
    border: 2px solid
        var(--panel-background);
    border-radius: 50%;

    outline: 1px solid
        var(--control-border-color);

    cursor: pointer;
}

.word-color-presets button:hover,
.word-color-presets button:focus-visible {
    transform: scale(1.1);
}

.word-color-presets
button[data-word-color="#1d1d1d"] {
    --preset-color: #1d1d1d;
}

.word-color-presets
button[data-word-color="#28543a"] {
    --preset-color: #28543a;
}

.word-color-presets
button[data-word-color="#66ff91"] {
    --preset-color: #66ff91;
}

.word-color-presets
button[data-word-color="#2b5d9b"] {
    --preset-color: #2b5d9b;
}

.word-color-presets
button[data-word-color="#7d2e3a"] {
    --preset-color: #7d2e3a;
}

.word-color-presets
button[data-word-color="#f3e3bd"] {
    --preset-color: #f3e3bd;
}

.custom-theme-editor {
    padding: 15px;

    background: var(--surface-soft);
    border: 1px solid
        var(--divider-color);
    border-radius: 12px;
}

.custom-theme-editor
.settings-help-text {
    margin:
        -7px
        0
        15px;
}

.theme-color-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;
}

.theme-color-grid label {
    display: grid;
    justify-items: center;

    gap: 7px;

    padding: 11px 8px;

    background: var(--surface-soft);
    border: 1px solid
        var(--divider-color);
    border-radius: 10px;

    font-size: 14px;
    text-align: center;

    cursor: pointer;
}

.selected-words-list li > span,
.search-result-word {
    font-family:
        var(--word-font-family);
}

.settings-secondary-button:disabled,
.settings-danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

@media (max-width: 460px) {
    .theme-management-actions {
        grid-template-columns: 1fr;
    }

    .theme-color-grid {
        grid-template-columns: 1fr;
    }

    .theme-color-grid label {
        grid-template-columns:
            1fr auto;
        align-items: center;
        justify-items: stretch;

        text-align: left;
    }
}

.theme-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;
    margin-top: 10px;
    padding: 10px 12px;

    background: var(--surface-soft);
    border: 1px solid var(--divider-color);
    border-radius: 10px;
}

.theme-preview-name {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 15px;
    opacity: 0.82;
}

.theme-preview-swatches {
    display: flex;
    align-items: center;
    gap: 6px;

    flex: 0 0 auto;
}

.theme-preview-swatch {
    display: inline-block;

    width: 22px;
    height: 22px;

    border: 2px solid var(--panel-background);
    border-radius: 50%;

    outline:
        1px solid
        var(--control-border-color);
}

.theme-name-form {
    display: grid;
    gap: 9px;

    margin-top: 12px;
    padding: 13px;

    background: var(--surface-soft);
    border: 1px solid var(--divider-color);
    border-radius: 11px;
}

.theme-name-form[hidden] {
    display: none;
}

.theme-name-form label {
    font-size: 15px;
    opacity: 0.82;
}

#theme-name-input {
    width: 100%;

    padding: 10px 12px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 16px;
}

.theme-name-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.theme-name-form-actions
.settings-secondary-button {
    width: auto;
    min-width: 96px;
}

.theme-name-error {
    min-height: 18px;

    font-size: 14px;
    line-height: 1.35;
    color: var(--danger-color);
}

.settings-help-text.has-unsaved-changes {
    color:
        var(
            --word-color,
            var(--theme-word-color)
        );

    font-weight: 600;
    opacity: 1;
}

.theme-reset-button {
    margin-top: 12px;
}

@media (max-width: 460px) {
    .theme-preview-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-name-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-name-form-actions
    .settings-secondary-button {
        width: 100%;
    }
}

/*
 * Flumenta onay ve bilgi penceresi
 */

#app-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 260;

    display: grid;
    place-items: center;

    padding: 24px;

    background:
        rgba(0, 0, 0, 0.46);

    backdrop-filter: blur(3px);
}

#app-dialog-overlay[hidden] {
    display: none;
}

.app-dialog {
    width: min(460px, 100%);

    padding: 24px;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 16px;

    color:
        var(--text-color);

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.32);
}

.app-dialog h2 {
    margin-bottom: 12px;

    font-size: 24px;
    font-weight: normal;
    line-height: 1.2;
}

/*
 * İlk kullanım rehberi
 */

#how-to-use-overlay {
    position: fixed;
    inset: 0;
    z-index: 255;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(4px);
}

#how-to-use-overlay[hidden] {
    display: none;
}

.how-to-use-dialog {
    position: relative;

    width: min(520px, 100%);
    padding: 30px;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 20px;

    color: var(--text-color);
    text-align: center;

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.32);
}

.how-to-use-close-button {
    position: absolute;
    top: 16px;
    right: 16px;
}

.how-to-use-visual {
    position: relative;

    width: 170px;
    height: 138px;

    margin: 2px auto 18px;

    display: grid;
    place-items: center;

    overflow: hidden;

    background:
        var(
            --surface-medium,
            rgba(91, 58, 41, 0.08)
        );

    border:
        1px solid
        var(--divider-color);

    border-radius: 42px;
}

.how-to-use-word-visual,
.how-to-use-list-visual,
.how-to-use-note-visual {
    display: none;
}

.how-to-use-visual[data-step="0"]
.how-to-use-word-visual,
.how-to-use-visual[data-step="1"]
.how-to-use-list-visual,
.how-to-use-visual[data-step="2"]
.how-to-use-note-visual {
    display: flex;
}

.how-to-use-word-visual {
    position: relative;
    align-items: center;
    justify-content: center;
}

.how-to-use-word-chip {
    padding: 9px 15px;

    background:
        var(
            --toolbar-background,
            #efe5d5
        );

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: var(--theme-word-color);
    font-family: var(--word-font-family);
    font-size: 18px;

    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.1);
}

.how-to-use-tap-ring {
    position: absolute;
    right: -7px;
    bottom: -14px;

    width: 28px;
    height: 28px;

    border:
        2px solid
        var(--theme-word-color);

    border-radius: 50%;
    opacity: 0.72;
}

.how-to-use-list-visual {
    position: relative;
    align-items: center;
}

.how-to-use-list-card {
    width: 82px;
    padding: 20px 17px;

    display: grid;
    gap: 9px;

    background:
        var(
            --toolbar-background,
            #efe5d5
        );

    border:
        1px solid
        var(--control-border-color);

    border-radius: 13px;

    box-shadow:
        0 9px 22px
        rgba(0, 0, 0, 0.1);
}

.how-to-use-list-card span {
    height: 3px;

    background: currentColor;
    border-radius: 999px;
    opacity: 0.55;
}

.how-to-use-list-visual svg {
    position: absolute;
    right: -28px;
    bottom: -18px;

    width: 48px;
    height: 48px;

    fill:
        var(
            --panel-background,
            #efe5d5
        );

    stroke: var(--theme-word-color);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.how-to-use-note-visual {
    position: relative;

    width: 90px;
    height: 98px;

    padding: 28px 16px 14px 23px;

    flex-direction: column;
    gap: 10px;

    background:
        repeating-linear-gradient(
            to bottom,
            var(--toolbar-background) 0,
            var(--toolbar-background) 23px,
            var(--divider-color) 24px
        );

    border:
        1px solid
        var(--control-border-color);

    border-radius: 8px 12px 12px 8px;

    box-shadow:
        0 9px 22px
        rgba(0, 0, 0, 0.1);
}

.how-to-use-spiral {
    position: absolute;
    top: 11px;
    left: -5px;

    width: 13px;
    height: 70px;

    border-top:
        2px solid
        currentColor;
    border-bottom:
        2px solid
        currentColor;
}

.how-to-use-spiral::before,
.how-to-use-spiral::after {
    content: "";

    position: absolute;
    left: 0;

    width: 13px;
    height: 2px;

    background: currentColor;
}

.how-to-use-spiral::before {
    top: 22px;
}

.how-to-use-spiral::after {
    bottom: 22px;
}

.how-to-use-note-line {
    height: 3px;
    width: 100%;

    background: currentColor;
    border-radius: 999px;
    opacity: 0.52;
}

.how-to-use-note-line.short {
    width: 68%;
}

.how-to-use-step-label {
    margin-bottom: 8px;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    opacity: 0.58;
}

.how-to-use-copy {
    min-height: 112px;
}

.how-to-use-copy h2 {
    margin-bottom: 12px;

    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 28px;
    line-height: 1.16;
}

.how-to-use-copy p {
    max-width: 420px;
    margin: 0 auto;

    font-size: 16px;
    line-height: 1.55;

    opacity: 0.76;
}

.how-to-use-progress {
    display: flex;
    justify-content: center;

    gap: 7px;
    margin: 20px 0 24px;
}

.how-to-use-progress-dot {
    width: 7px;
    height: 7px;

    background: currentColor;
    border-radius: 999px;

    opacity: 0.24;

    transition:
        width 160ms ease,
        opacity 160ms ease;
}

.how-to-use-progress-dot.is-active {
    width: 24px;
    opacity: 0.72;
}

.how-to-use-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.how-to-use-navigation {
    display: flex;
    gap: 9px;
}

.how-to-use-button {
    min-height: 42px;
    padding: 9px 17px;

    background: transparent;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 15px;

    cursor: pointer;
}

.how-to-use-button:hover {
    background:
        var(--interaction-hover-background);
}

.how-to-use-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.how-to-use-primary-button {
    background: var(--theme-word-color);
    color: var(--page-background);
}

.how-to-use-primary-button:hover {
    filter: brightness(1.08);
}

.how-to-use-skip-button {
    border-color: transparent;
    opacity: 0.7;
}

.how-to-use-button[hidden] {
    display: none;
}

/*
 * Hakkında, gizlilik ve kaynaklar
 */

#about-overlay,
#privacy-overlay,
#sources-licenses-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(4px);
}

#about-overlay[hidden],
#privacy-overlay[hidden],
#sources-licenses-overlay[hidden] {
    display: none;
}

.about-privacy-panel {
    width: min(620px, 100%);
    max-height: min(760px, 88vh);

    padding: 28px;
    overflow-y: auto;
    overscroll-behavior: contain;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 20px;

    color: var(--text-color);

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.32);
}

.about-privacy-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;
    margin-bottom: 16px;
}

.about-privacy-eyebrow {
    margin-bottom: 5px;

    color: var(--theme-word-color);

    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 15px;
    font-weight: 650;
}

.about-privacy-header h2 {
    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 28px;
    line-height: 1.16;
}

.about-privacy-intro {
    max-width: 520px;
    margin-bottom: 22px;

    font-size: 16px;
    line-height: 1.55;

    opacity: 0.76;
}

.about-privacy-note {
    margin-top: 18px;
    padding-top: 16px;

    border-top:
        1px solid
        var(--divider-color);

    font-size: 13px;
    line-height: 1.5;
    opacity: 0.66;
}

.about-privacy-facts {
    display: grid;
    gap: 10px;
}

.about-privacy-facts article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;

    gap: 14px;
    padding: 16px;

    background: var(--surface-medium);

    border:
        1px solid
        var(--divider-color);

    border-radius: 13px;
}

.about-privacy-facts svg {
    width: 27px;
    height: 27px;

    fill: none;
    stroke: var(--theme-word-color);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.about-privacy-facts h3 {
    margin-bottom: 5px;

    font-size: 17px;
    font-weight: 650;
}

.about-privacy-facts p {
    font-size: 14px;
    line-height: 1.48;

    opacity: 0.72;
}

.about-privacy-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;

    border-top:
        1px solid
        var(--divider-color);
}

.about-privacy-footer > div {
    display: grid;
    gap: 3px;
}

.about-privacy-footer span {
    font-size: 12px;
    opacity: 0.58;
}

.about-privacy-footer strong {
    font-size: 14px;
    font-weight: 650;
}

.about-privacy-footer a {
    min-height: 42px;
    padding: 9px 16px;

    display: inline-flex;
    align-items: center;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font-size: 14px;
    text-decoration: none;
}

.about-privacy-footer a:hover {
    background:
        var(--interaction-hover-background);
}

.sources-licenses-sections {
    display: grid;
    gap: 10px;
}

.sources-licenses-sections article {
    padding: 17px;

    background: var(--surface-medium);

    border:
        1px solid
        var(--divider-color);

    border-radius: 13px;
}

.sources-licenses-sections h3 {
    margin-bottom: 6px;

    font-size: 17px;
    font-weight: 650;
}

.sources-licenses-sections p,
.sources-licenses-note {
    font-size: 14px;
    line-height: 1.52;

    opacity: 0.72;
}

.sources-licenses-list {
    display: grid;
    gap: 13px;

    margin: 12px 0 0;
    padding: 0;

    list-style: none;
}

.sources-licenses-list li {
    padding-top: 13px;

    border-top:
        1px solid
        var(--divider-color);
}

.sources-licenses-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.sources-licenses-list li > a {
    display: inline-block;

    color: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.sources-licenses-list li > span {
    display: block;

    margin-top: 4px;

    font-size: 13px;
    line-height: 1.5;

    opacity: 0.72;
}

.sources-licenses-list span a {
    color: inherit;
    font-weight: 600;
    text-underline-offset: 2px;
}

.sources-licenses-list a:focus-visible {
    outline:
        2px solid
        var(--theme-word-color);
    outline-offset: 3px;
    border-radius: 3px;
}

.sources-licenses-status {
    border-left:
        3px solid
        var(--theme-word-color) !important;
}

.sources-licenses-note {
    margin-top: 18px;
    padding-top: 16px;

    border-top:
        1px solid
        var(--divider-color);
}

@media (max-width: 520px) {
    #how-to-use-overlay {
        padding: 12px;
    }

    .how-to-use-dialog {
        padding: 24px 18px 20px;
        border-radius: 17px;
    }

    .how-to-use-visual {
        width: 150px;
        height: 120px;

        margin-bottom: 15px;
        border-radius: 35px;
    }

    .how-to-use-copy {
        min-height: 124px;
    }

    .how-to-use-copy h2 {
        font-size: 24px;
    }

    .how-to-use-copy p {
        font-size: 15px;
    }

    .how-to-use-progress {
        margin: 15px 0 19px;
    }

    .how-to-use-actions {
        align-items: stretch;
    }

    .how-to-use-navigation {
        margin-left: auto;
    }

    .how-to-use-button {
        padding-right: 14px;
        padding-left: 14px;
    }

    #about-overlay,
    #privacy-overlay,
    #sources-licenses-overlay {
        padding: 12px;
    }

    .about-privacy-panel {
        max-height:
            calc(100dvh - 24px);

        padding: 22px 18px;
        border-radius: 17px;
    }

    .about-privacy-header h2 {
        font-size: 24px;
    }

    .about-privacy-facts article {
        padding: 14px;
    }

    .about-privacy-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .about-privacy-footer a {
        justify-content: center;
    }
}

#app-dialog-message {
    font-size: 16px;
    line-height: 1.55;
    white-space: pre-line;

    opacity: 0.82;
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 10px;
    margin-top: 24px;
}

.app-dialog-button {
    min-width: 110px;

    padding: 10px 17px;

    background: transparent;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 16px;

    cursor: pointer;
}

.app-dialog-button:hover,
.app-dialog-button:focus-visible {
    background:
        var(--interaction-hover-background);
}

.app-dialog-button:focus-visible {
    outline:
        2px solid currentColor;

    outline-offset: 3px;
}

.app-dialog-confirm-button {
    background:
        var(--surface-medium);
}

.app-dialog-confirm-button.is-danger {
    background:
        var(--danger-hover-background);

    border-color:
        var(--danger-border-color);

    color:
        var(--danger-color);
}

.app-dialog-confirm-button.is-danger:hover,
.app-dialog-confirm-button.is-danger:focus-visible {
    background:
        var(--danger-hover-background);

    filter: brightness(1.08);
}

@media (max-width: 460px) {
    #app-dialog-overlay {
        padding: 14px;
    }

    .app-dialog {
        padding: 20px;
    }

    .app-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .app-dialog-button {
        width: 100%;
    }
}

/*
 * Kayıtlı kelime işlem menüsü
 */

.selected-words-list
li.selected-word-item {
    display: block;

    padding: 0;

    overflow: hidden;
}

.selected-word-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
    padding: 12px 14px;
}

.selected-word-order {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;

    min-width: 36px;

    flex: 0 0 auto;
    gap: 7px;

    font-size: 15px;
    font-variant-numeric: tabular-nums;
    line-height: 1;

    opacity: 0.58;
}

.selected-word-order-dot {
    width: 6px;
    height: 6px;

    flex: 0 0 auto;

    background: currentColor;
    border-radius: 50%;
}

.selected-word-text {
    min-width: 0;

    overflow-wrap: anywhere;

    font-family:
        var(--word-font-family);
    font-size: 22px;
}

.word-actions-button {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    padding: 0;

    background: transparent;
    border:
        1px solid
        var(--control-border-color);
    border-radius: 50%;

    color: inherit;
    font: inherit;
    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.word-actions-button:hover,
.word-actions-button:focus-visible,
.word-actions-button[aria-expanded="true"] {
    background:
        var(--interaction-hover-background);
}

.word-actions-button:focus-visible {
    outline:
        2px solid currentColor;
    outline-offset: 3px;
}

.word-actions-menu {
    display: grid;
    gap: 6px;

    padding:
        10px
        12px
        12px;

    background:
        var(--surface-soft);

    border-top:
        1px solid
        var(--divider-color);
}

.word-actions-menu[hidden] {
    display: none;
}

.word-action-menu-button {
    width: 100%;

    padding: 10px 12px;

    background: transparent;
    border:
        1px solid
        transparent;
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 15px;
    text-align: left;

    cursor: pointer;
}

.word-action-menu-button:hover,
.word-action-menu-button:focus-visible {
    background:
        var(--interaction-hover-background);

    border-color:
        var(--divider-color);
}

.word-action-menu-button:focus-visible {
    outline:
        2px solid currentColor;
    outline-offset: 2px;
}

.word-action-menu-button.is-danger {
    color:
        var(--danger-color);
}

.word-action-menu-button.is-danger:hover,
.word-action-menu-button.is-danger:focus-visible {
    background:
        var(--danger-hover-background);

    border-color:
        var(--danger-border-color);
}

.word-action-menu-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

/*
 * Ortak uyarı penceresindeki liste seçimi
 */

.app-dialog-choice-field {
    display: grid;
    gap: 8px;

    margin-top: 18px;
}

.app-dialog-choice-field[hidden] {
    display: none;
}

.app-dialog-choice-field label {
    font-size: 15px;
    opacity: 0.78;
}

#app-dialog-choice-select {
    width: 100%;

    padding: 11px 12px;

    background:
        var(--surface-medium);

    border:
        1px solid
        var(--control-border-color);

    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 16px;

    cursor: pointer;
}

#app-dialog-choice-select:focus-visible {
    outline:
        2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 460px) {
    .selected-word-main-row {
        padding:
            11px
            12px;
    }

    .word-action-menu-button {
        min-height: 44px;
    }
}


/*
 * Arama kapsamı ve tüm kelimeler araması
 */

.search-scope-control {
    margin: 0 0 18px;
    padding: 0;

    border: 0;
}

.search-mode-control {
    margin: 0 0 14px;
    padding: 0 0 15px;

    border: 0;
    border-bottom:
        1px solid
        var(--divider-color);
}

.search-mode-control[hidden],
.search-scope-control[hidden],
.search-match-control[hidden] {
    display: none;
}

.search-mode-control legend {
    margin-bottom: 8px;

    font-size: 15px;
    opacity: 0.72;
}

.search-mode-options {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px;
    padding: 5px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 12px;
}

.search-mode-option {
    position: relative;

    min-width: 0;
    cursor: pointer;
}

.search-mode-option input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.search-mode-option span {
    min-height: 48px;
    padding: 7px 10px;

    display: grid;
    place-items: center;
    gap: 2px;

    border:
        1px solid
        transparent;
    border-radius: 9px;

    font-size: 14px;
    line-height: 1.2;
    text-align: center;

    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
}

.search-mode-option small {
    color: var(--theme-word-color);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-mode-option:hover span {
    background:
        var(
            --interaction-hover-background
        );
}

.search-mode-option
input:checked + span {
    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 10%,
            var(--surface-medium)
        );

    border-color:
        color-mix(
            in srgb,
            var(--theme-word-color) 46%,
            var(--control-border-color)
        );

    box-shadow:
        0 5px 14px
        rgba(0, 0, 0, 0.08);
}

.search-mode-option
input:focus-visible + span {
    outline:
        2px solid
        currentColor;

    outline-offset: 3px;
}

.semantic-search-empty {
    display: grid;
    gap: 8px;

    padding: 22px 16px;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 7%,
            var(--surface-soft)
        );

    border:
        1px dashed
        color-mix(
            in srgb,
            var(--theme-word-color) 42%,
            var(--divider-color)
        );
    border-radius: 13px;

    text-align: center;
}

.semantic-search-empty strong {
    font-size: 18px;
}

.semantic-search-empty p {
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.7;
}

.semantic-search-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 7px;
    margin-top: 6px;
}

.semantic-search-preset {
    min-height: 38px;
    padding: 7px 12px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 13px;

    cursor: pointer;
}

.semantic-search-preset:hover,
.semantic-search-preset:focus-visible {
    background:
        var(
            --interaction-hover-background
        );
}

.semantic-search-preset:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.semantic-search-result-copy {
    min-width: 0;

    display: grid;
    gap: 3px;
}

.semantic-search-reason {
    font-size: 12px;
    line-height: 1.35;
    opacity: 0.64;
}

.search-scope-control legend {
    margin-bottom: 8px;

    font-size: 15px;
    opacity: 0.72;
}

.search-scope-options {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px;
    padding: 5px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 12px;
}

.search-scope-option {
    position: relative;

    min-width: 0;

    cursor: pointer;
}

.search-scope-option input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.search-scope-option span {
    display: grid;
    place-items: center;

    min-height: 42px;
    padding: 8px 10px;

    border:
        1px solid
        transparent;
    border-radius: 9px;

    font-size: 14px;
    line-height: 1.25;
    text-align: center;

    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
}

.search-scope-option:hover span {
    background:
        var(
            --interaction-hover-background
        );
}

.search-scope-option
input:checked + span {
    background:
        var(--surface-medium);

    border-color:
        var(--control-border-color);

    box-shadow:
        0 5px 14px
        rgba(0, 0, 0, 0.08);
}

.search-scope-option
input:focus-visible + span {
    outline:
        2px solid
        currentColor;

    outline-offset: 3px;
}

.search-active-list-hint {
    margin-top: 10px;

    font-size: 14px;
    line-height: 1.4;
    opacity: 0.72;
}

.search-active-list-hint[hidden] {
    display: none;
}

.search-all-word-item {
    gap: 14px;
}

.search-add-word-button {
    flex: 0 0 auto;

    min-width: 86px;
    padding: 8px 14px;

    background: transparent;
    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 14px;

    cursor: pointer;
}

.search-add-word-button:hover:not(:disabled),
.search-add-word-button:focus-visible:not(:disabled) {
    background:
        var(
            --interaction-hover-background
        );
}

.search-add-word-button:focus-visible {
    outline:
        2px solid
        currentColor;

    outline-offset: 3px;
}

.search-add-word-button:disabled {
    cursor: default;
    opacity: 0.56;
}

@media (max-width: 480px) {
    .search-mode-options {
        grid-template-columns: 1fr;
    }

    .search-scope-options {
        grid-template-columns: 1fr;
    }

    .search-all-word-item {
        align-items: stretch;
        flex-direction: column;
    }

    .search-add-word-button {
        align-self: flex-end;
    }

    .semantic-search-results li {
        align-items: stretch;
        flex-direction: column;
    }
}


/*
 * Toplu kelime seçimi ve işlemleri
 */

.word-selection-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 10px;
    margin: 4px 0 16px;
}

.word-selection-mode-button,
.word-selection-shortcut-button,
.bulk-word-action-button {
    padding: 9px 14px;

    background: transparent;
    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 14px;

    cursor: pointer;
}

.word-selection-mode-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;
}

.word-selection-mode-icon {
    width: 18px;
    height: 18px;

    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.word-selection-mode-button:hover:not(:disabled),
.word-selection-mode-button:focus-visible:not(:disabled),
.word-selection-shortcut-button:hover:not(:disabled),
.word-selection-shortcut-button:focus-visible:not(:disabled),
.bulk-word-action-button:hover:not(:disabled),
.bulk-word-action-button:focus-visible:not(:disabled) {
    background:
        var(--interaction-hover-background);
}

.word-selection-mode-button:focus-visible,
.word-selection-shortcut-button:focus-visible,
.bulk-word-action-button:focus-visible {
    outline:
        2px solid currentColor;
    outline-offset: 3px;
}

.word-selection-mode-button[aria-pressed="true"] {
    background:
        var(--surface-medium);

    border-color:
        var(--theme-word-color);
}

.word-selection-mode-button:disabled,
.word-selection-shortcut-button:disabled,
.bulk-word-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.word-selection-shortcuts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;
}

.word-selection-shortcuts[hidden] {
    display: none;
}

.selected-words-list
li.bulk-selected-word-item {
    display: block;

    padding: 0;

    overflow: hidden;

    transition:
        background 0.16s ease,
        border-color 0.16s ease;
}

.selected-words-list
li.bulk-selected-word-item.is-selected {
    background:
        var(--surface-soft);

    border-color:
        var(--control-border-color);
}

.bulk-word-selection-label {
    display: flex;
    align-items: center;

    width: 100%;

    gap: 13px;
    padding: 13px 14px;

    cursor: pointer;
}

.bulk-word-selection-label
.selected-word-text {
    min-width: 0;
    flex: 1;
}

.bulk-word-selection-label:hover {
    background:
        var(--interaction-hover-background);
}

.bulk-word-checkbox {
    width: 20px;
    height: 20px;

    flex: 0 0 auto;

    cursor: pointer;
}

.bulk-word-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 3;

    display: grid;
    gap: 11px;

    margin-top: 18px;
    padding: 13px;

    background:
        var(--panel-background);

    border:
        1px solid
        var(--panel-border-color);
    border-radius: 13px;

    box-shadow:
        0 -12px 30px
        rgba(0, 0, 0, 0.14);
}

.bulk-word-action-bar[hidden] {
    display: none;
}

.bulk-word-selection-count {
    margin: 0;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.bulk-word-action-buttons {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;
}

.bulk-word-action-button {
    min-width: 0;
}

.bulk-word-action-button.is-danger {
    border-color:
        var(--danger-border-color);

    color:
        var(--danger-color);
}

.bulk-word-action-button.is-danger:hover:not(:disabled),
.bulk-word-action-button.is-danger:focus-visible:not(:disabled) {
    background:
        var(--danger-hover-background);
}

@media (max-width: 480px) {
    .word-selection-mode-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .word-selection-mode-button {
        width: 100%;
        min-height: 44px;
    }

    .word-selection-shortcuts {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .word-selection-shortcut-button {
        min-width: 0;
    }

    .bulk-word-action-buttons {
        grid-template-columns: 1fr;
    }

    .bulk-word-action-button {
        min-height: 43px;
    }
}
/*
 * Kişisel notlar
 */

.selected-word-info {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 6px;
}

.selected-word-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;
}

.word-note-indicator {
    display: inline-flex;
    align-items: center;

    width: max-content;
    max-width: 100%;

    padding: 4px 8px;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--divider-color);

    border-radius: 999px;

    font-size: 12px;
    line-height: 1.15;
}

.word-note-indicator {
    color:
        var(
            --word-color,
            var(--theme-word-color)
        );
}

#notes-overlay,
#word-details-overlay {
    position: fixed;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 24px;

    background:
        rgba(0, 0, 0, 0.34);
}

#notes-overlay {
    z-index: 110;
}

#word-details-overlay {
    z-index: 180;

    background:
        rgba(0, 0, 0, 0.48);

    backdrop-filter: blur(3px);
}

#notes-overlay[hidden],
#word-details-overlay[hidden] {
    display: none;
}

.notes-panel {
    width: min(620px, 100%);
    max-height: min(760px, 84vh);

    padding:
        0
        26px
        26px;

    overflow-y: auto;
    overscroll-behavior-y: none;
    scrollbar-gutter: stable;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 16px;

    box-shadow:
        0 18px 60px
        rgba(0, 0, 0, 0.24);

    -webkit-overflow-scrolling: touch;
}

.notes-panel-header {
    position: sticky;
    top: 0;
    z-index: 4;

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

    gap: 20px;

    margin:
        0
        -26px
        18px;

    padding:
        26px
        26px
        14px;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border-bottom:
        1px solid
        var(--divider-color);

    border-radius:
        15px
        15px
        0
        0;

    box-shadow:
        0
        10px
        16px
        -14px
        rgba(0, 0, 0, 0.72);
}

.notes-panel-header h2 {
    font-size: 26px;
    font-weight: normal;
}

.notes-intro {
    margin-bottom: 18px;

    font-size: 15px;
    line-height: 1.5;
    opacity: 0.75;
}

#notes-search-input {
    width: 100%;

    padding: 12px 14px;

    background:
        var(--surface-medium);

    border:
        1px solid
        var(--control-border-color);

    border-radius: 10px;

    color: inherit;
    font: inherit;
    font-size: 18px;
}

.notes-result-summary {
    min-height: 20px;

    margin: 14px 0 10px;

    font-size: 14px;
    opacity: 0.68;
}

.notes-list {
    display: grid;
    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.notes-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
    padding: 14px;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--divider-color);

    border-radius: 12px;
}

.notes-list-main {
    display: grid;
    min-width: 0;
    gap: 8px;
}

.notes-list-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 9px;
}

.notes-list-word {
    min-width: 0;

    overflow-wrap: anywhere;

    color:
        var(
            --word-color,
            var(--theme-word-color)
        );

    font-family:
        var(--word-font-family);
    font-size: 22px;
}

.notes-list-preview {
    display: -webkit-box;

    overflow: hidden;

    font-size: 15px;
    line-height: 1.45;

    white-space: pre-line;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.notes-list-preview.is-empty {
    font-style: italic;
    opacity: 0.55;
}

.notes-list-location {
    font-size: 12px;
    line-height: 1.35;
    opacity: 0.58;
}

.notes-edit-button {
    flex: 0 0 auto;

    padding: 9px 14px;

    background: transparent;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 14px;

    cursor: pointer;
}

.notes-edit-button:hover,
.notes-edit-button:focus-visible {
    background:
        var(--interaction-hover-background);
}

.notes-edit-button:focus-visible,
#notes-search-input:focus-visible {
    outline:
        2px solid
        currentColor;

    outline-offset: 3px;
}

.notes-empty-message {
    padding: 34px 10px;

    text-align: center;
    font-size: 17px;
    line-height: 1.5;
    opacity: 0.65;
}

.word-details-panel {
    width: min(560px, 100%);
    max-height: min(760px, 88vh);

    padding: 25px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 16px;

    color: var(--text-color);

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.34);
}

.word-details-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
    margin-bottom: 24px;
}

.word-details-eyebrow {
    margin-bottom: 5px;

    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.58;
}


.word-details-list-context {
    margin-top: 5px;

    font-size: 13px;
    line-height: 1.35;
    opacity: 0.68;
}

.word-details-header h2 {
    min-width: 0;

    overflow-wrap: anywhere;

    color:
        var(
            --word-color,
            var(--theme-word-color)
        );

    font-family:
        var(--word-font-family);
    font-size: 31px;
    font-weight: normal;
    line-height: 1.15;
}

.word-dictionary-summary {
    display: grid;
    gap: 12px;

    margin-bottom: 22px;
    padding: 16px;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--divider-color);

    border-radius: 12px;
}

.word-dictionary-summary h3 {
    font-size: 15px;
    font-weight: normal;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.62;
}

.word-dictionary-facts {
    display: grid;
    gap: 11px;

    margin: 0;
}

.word-dictionary-facts > div {
    display: grid;
    grid-template-columns:
        minmax(112px, 0.36fr)
        minmax(0, 1fr);

    gap: 12px;
}

.word-dictionary-facts dt {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.6;
}

.word-dictionary-facts dd {
    min-width: 0;

    margin: 0;

    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.word-dictionary-theme-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px;
}

.word-dictionary-theme-chip {
    display: inline-flex;
    align-items: center;

    padding: 3px 8px;

    background:
        var(--surface-medium);

    border:
        1px solid
        var(--divider-color);

    border-radius: 999px;

    font-size: 12px;
    line-height: 1.25;
}

.word-dictionary-facts
.is-unknown {
    font-style: italic;
    opacity: 0.58;
}

.word-dictionary-summary-note {
    padding-top: 2px;

    font-size: 12px;
    line-height: 1.4;
    opacity: 0.52;
}

.word-insight-card {
    display: grid;
    gap: 14px;

    margin-bottom: 22px;
    padding: 17px;

    background:
        linear-gradient(
            135deg,
            color-mix(
                in srgb,
                var(--theme-word-color) 11%,
                var(--surface-soft)
            ),
            var(--surface-soft) 68%
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 42%,
            var(--divider-color)
        );

    border-radius: 13px;

    box-shadow:
        inset 3px 0
        var(--theme-word-color);
}

.word-insight-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;
}

.word-insight-kicker {
    margin-bottom: 4px;

    color: var(--theme-word-color);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.word-insight-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.word-insight-badge {
    flex: 0 0 auto;

    padding: 5px 9px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--divider-color);
    border-radius: 999px;

    font-size: 11px;
    line-height: 1.2;
}

.word-insight-content {
    display: grid;
    gap: 13px;
}

.word-insight-message {
    font-size: 14px;
    line-height: 1.55;
    opacity: 0.76;
}

.word-insight-word-type {
    font-size: 13px;
    font-style: italic;
    opacity: 0.64;
}

.word-insight-senses {
    display: grid;
    gap: 13px;

    margin: 0;
    padding-left: 22px;

    font-size: 15px;
    line-height: 1.52;
}

.word-insight-senses.is-single {
    padding-left: 0;

    list-style: none;
}

.word-insight-senses > li {
    padding-left: 3px;
}

.word-insight-senses > li::marker {
    color: var(--theme-word-color);
    font-weight: 700;
}

.word-insight-definition {
    margin: 0;
}

.word-insight-sense-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;

    margin-bottom: 6px;
}

.word-insight-sense-labels span {
    padding: 3px 7px;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 10%,
            var(--surface-medium)
        );

    border:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 24%,
            var(--divider-color)
        );

    border-radius: 999px;

    font-size: 11px;
    line-height: 1.25;
}

.word-insight-examples {
    display: grid;
    gap: 5px;

    margin-top: 8px;
    padding: 9px 11px;

    background:
        color-mix(
            in srgb,
            var(--surface-medium) 78%,
            transparent
        );

    border-radius: 9px;
}

.word-insight-examples strong {
    font-size: 11px;
    letter-spacing: 0.02em;
    opacity: 0.62;
}

.word-insight-examples ul {
    display: grid;
    gap: 4px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.word-insight-examples li {
    font-size: 13px;
    line-height: 1.48;
}

.word-insight-examples li::before {
    content: "“";
}

.word-insight-examples li::after {
    content: "”";
}

.word-insight-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.word-insight-labels span {
    padding: 4px 8px;

    background: var(--surface-medium);
    border-radius: 999px;

    font-size: 12px;
}

.word-insight-relations {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.word-insight-relation {
    padding: 11px;

    background:
        color-mix(
            in srgb,
            var(--surface-medium) 82%,
            transparent
        );

    border-radius: 10px;
}

.word-insight-relation h4 {
    margin-bottom: 6px;

    font-size: 12px;
    font-weight: 700;
}

.word-insight-relation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 9px;

    margin: 0;
    padding: 0;

    list-style: none;
    font-size: 13px;
    line-height: 1.4;
}

.word-insight-attributions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;

    padding-top: 10px;

    border-top:
        1px solid
        var(--divider-color);

    font-size: 11px;
    line-height: 1.4;
    opacity: 0.68;
}

.word-insight-attributions strong {
    flex-basis: 100%;
}

.word-insight-attributions a {
    color: inherit;
}

.word-insight-membership-button {
    justify-self: start;

    min-height: 40px;
    padding: 9px 14px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 14px;

    cursor: pointer;
}

.word-insight-membership-button:hover,
.word-insight-membership-button:focus-visible {
    background:
        var(--interaction-hover-background);
}

.word-insight-membership-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.word-insight-membership-button[hidden] {
    display: none;
}

.word-pin-control {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
    margin-bottom: 22px;
    padding: 14px 16px;

    background:
        var(--surface-soft);

    border:
        1px solid
        var(--divider-color);

    border-radius: 12px;
}

.word-pin-control > div {
    display: grid;
    gap: 4px;

    min-width: 0;
}

.word-pin-control h3 {
    font-size: 15px;
    font-weight: normal;
}

.word-pin-control p {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.65;
}

#toggle-word-pin-button {
    flex: 0 0 auto;

    padding: 9px 14px;

    background: transparent;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 14px;

    cursor: pointer;
}

#toggle-word-pin-button:hover,
#toggle-word-pin-button:focus-visible,
#toggle-word-pin-button.is-pinned {
    background:
        var(--surface-medium);
}

#toggle-word-pin-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

#word-details-form {
    display: grid;
    gap: 18px;
}

.word-details-field {
    display: grid;
    gap: 8px;
}

.word-details-field > span {
    font-size: 16px;
    opacity: 0.82;
}

#word-note-input {
    width: 100%;

    background:
        var(--surface-medium);

    border:
        1px solid
        var(--control-border-color);

    border-radius: 10px;

    color: inherit;
    font: inherit;
}

#word-note-input {
    min-height: 180px;
    padding: 13px 14px;

    resize: vertical;

    font-size: 16px;
    line-height: 1.55;
}

#word-note-input:focus-visible {
    outline:
        2px solid
        currentColor;

    outline-offset: 3px;
}

.word-note-character-count {
    margin-top: -12px;

    text-align: right;
    font-size: 12px;
    opacity: 0.58;
}

.word-details-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 12px;
    margin-top: 4px;
}

.word-details-primary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 9px;
    margin-left: auto;
}

.word-details-actions button {
    padding: 10px 16px;

    background: transparent;

    border:
        1px solid
        var(--control-border-color);

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 15px;

    cursor: pointer;
}

.word-details-actions button:hover,
.word-details-actions button:focus-visible {
    background:
        var(--interaction-hover-background);
}

.word-details-actions button:focus-visible {
    outline:
        2px solid
        currentColor;

    outline-offset: 3px;
}

.word-details-actions
button[type="submit"] {
    background:
        var(--surface-medium);
}

.word-details-clear-button {
    border-color:
        var(--danger-border-color)
        !important;

    color:
        var(--danger-color)
        !important;
}

.word-details-clear-button:hover,
.word-details-clear-button:focus-visible {
    background:
        var(--danger-hover-background)
        !important;
}

.word-details-clear-button[hidden] {
    display: none;
}

@media
    (max-width: 600px),
    (max-height: 650px) {

    #notes-overlay,
    #word-details-overlay {
        padding: 12px;
    }

    .notes-panel,
    .word-details-panel {
        width: 100%;
        max-height:
            calc(100dvh - 24px);
    }

    .notes-panel {
        padding:
            0
            18px
            22px;
    }

    .notes-panel-header {
        margin:
            0
            -18px
            14px;

        padding:
            22px
            18px
            12px;
    }

    .notes-panel-header h2 {
        font-size: 23px;
    }

    .word-details-panel {
        padding: 20px;
    }

    .word-details-header h2 {
        font-size: 27px;
    }

    .word-dictionary-facts > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .word-insight-header {
        align-items: stretch;
        flex-direction: column;
    }

    .word-insight-badge {
        align-self: flex-start;
    }

    .word-insight-relations {
        grid-template-columns: 1fr;
    }

    .word-pin-control {
        align-items: stretch;
        flex-direction: column;
    }

    #toggle-word-pin-button {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .notes-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-edit-button {
        align-self: flex-end;
    }

    .word-details-actions,
    .word-details-primary-actions {
        align-items: stretch;
        flex-direction: column;

        width: 100%;
    }

    .word-details-primary-actions {
        margin-left: 0;
    }

    .word-details-actions button {
        width: 100%;
        min-height: 44px;
    }

    #toggle-word-pin-button {
        align-self: stretch;
        min-height: 44px;
    }
}


/*
 * Genel not defteri
 */

.notebook-note-toolbar {
    margin-bottom: 18px;
}

.notebook-note-toolbar > label {
    display: block;

    margin-bottom: 7px;

    font-size: 16px;
    opacity: 0.72;
}

.notebook-note-primary-actions {
    display: flex;
    gap: 10px;
}

#notebook-note-select {
    min-width: 0;
    flex: 1;

    padding: 10px 12px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 17px;

    cursor: pointer;
}

#show-create-note-button,
.notebook-note-management-actions button,
.notebook-note-name-actions button,
#save-notebook-note-button,
.notebook-page-snapshot-save-button {
    padding: 10px 15px;

    background: transparent;
    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-size: 15px;

    cursor: pointer;
}

#show-create-note-button:hover,
.notebook-note-management-actions
button:hover:not(:disabled),
.notebook-note-name-actions
button:hover,
#save-notebook-note-button:hover {
    background:
        var(--interaction-hover-background);
}

#show-create-note-button:focus-visible,
.notebook-note-management-actions
button:focus-visible,
.notebook-note-name-actions
button:focus-visible,
#save-notebook-note-button:focus-visible,
#notebook-note-select:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.notebook-note-management-actions {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;

    margin-top: 16px;
}

.notebook-note-management-actions
button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.notebook-note-management-actions
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 0;

    white-space: nowrap;
}

.notebook-note-management-actions
.danger-button {
    border-color:
        var(--danger-border-color);

    color:
        var(--danger-color);
}

.notebook-note-management-actions
.danger-button:hover:not(:disabled) {
    background:
        var(--danger-hover-background);
}

.notebook-note-name-form {
    display: grid;
    gap: 9px;

    margin-bottom: 18px;
    padding: 14px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 11px;
}

.notebook-note-name-form[hidden] {
    display: none;
}

.notebook-note-name-form label {
    font-size: 15px;
    opacity: 0.8;
}

#new-note-title,
#rename-note-title {
    width: 100%;

    padding: 10px 12px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 17px;
}

#new-note-title:focus-visible,
#rename-note-title:focus-visible,
#notebook-note-content:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.notebook-note-name-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.notebook-note-form-error {
    min-height: 18px;

    font-size: 14px;
    line-height: 1.35;
    color: var(--danger-color);
}

.notebook-note-empty {
    padding: 34px 14px;

    background: var(--surface-soft);
    border:
        1px dashed
        var(--control-border-color);
    border-radius: 12px;

    text-align: center;
}

.notebook-note-empty[hidden] {
    display: none;
}

.notebook-note-empty p {
    line-height: 1.5;
}

.notebook-note-empty p + p {
    margin-top: 5px;
    font-size: 14px;
    opacity: 0.7;
}

.notebook-page-stage {
    position: relative;

    perspective: 1500px;
    perspective-origin: left center;
    touch-action: pan-y;
    transform-style: preserve-3d;
}

.notebook-page-stage.is-touch-swiping
.notebook-note-editor {
    transition: none;

    transform:
        translateX(
            var(
                --notebook-swipe-offset,
                0px
            )
        );
}

.notebook-page-stage.is-touch-releasing
.notebook-note-editor {
    transition:
        transform
        160ms
        ease-out;

    transform:
        translateX(
            var(
                --notebook-swipe-offset,
                0px
            )
        );
}

.notebook-note-editor {
    position: relative;
    isolation: isolate;

    display: grid;
    gap: 12px;

    padding:
        22px
        20px
        20px
        56px;

    background:
        linear-gradient(
            to right,
            transparent 0,
            transparent 43px,
            var(--divider-color) 43px,
            var(--divider-color) 44px,
            transparent 44px
        ),
        var(--surface-soft);

    border:
        1px solid
        var(--control-border-color);

    border-radius:
        7px
        13px
        13px
        7px;

    box-shadow:
        4px 4px 0
        var(--panel-background),
        5px 5px 0
        var(--divider-color),
        0 14px 28px
        rgba(0, 0, 0, 0.08);

    transform-origin: left center;
}

.notebook-note-editor::before {
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 22px;

    z-index: 0;

    width: 12px;

    background:
        radial-gradient(
            circle,
            var(--panel-background) 0 3px,
            currentColor 3.2px 4px,
            transparent 4.2px
        )
        center top /
        12px 24px
        repeat-y;

    content: "";
    opacity: 0.42;
}

.notebook-note-editor::after {
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 4px;

    z-index: 0;

    width: 25px;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0 7px,
            currentColor 7px 8.5px,
            transparent 8.5px 24px
        );

    content: "";
    opacity: 0.34;
}

.notebook-note-editor > * {
    position: relative;
    z-index: 1;
}

.notebook-note-editor[hidden] {
    display: none;
}

.notebook-note-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;
}

.notebook-note-eyebrow {
    margin-bottom: 4px;

    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.58;
}

#active-notebook-note-title,
.notebook-page-snapshot-title {
    font-size: 23px;
    font-weight: normal;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.notebook-note-date {
    flex: 0 0 auto;

    max-width: 180px;

    font-size: 12px;
    line-height: 1.35;
    text-align: right;
    opacity: 0.6;
}

.notebook-note-content-label {
    font-size: 15px;
    opacity: 0.78;
}

#notebook-note-content,
.notebook-page-snapshot-content {
    width: 100%;
    min-height: 260px;
    resize: vertical;

    padding: 0 12px 8px;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 23px,
            var(--divider-color) 23px,
            var(--divider-color) 24px,
            transparent 24px,
            transparent 32px
        ),
        var(--surface-soft);

    background-attachment: local;
    border: 0;
    border-radius: 4px;

    color: inherit;
    font: inherit;
    font-size: 17px;
    line-height: 32px;
}

.notebook-note-editor.is-page-arriving,
.notebook-note-editor.is-page-revealing-forward,
.notebook-note-editor.is-page-revealing-backward,
.notebook-page-turn-snapshot {
    will-change:
        transform,
        filter,
        box-shadow,
        clip-path,
        border-radius;
}

.notebook-note-editor.is-page-arriving {
    animation:
        notebook-page-arrive
        420ms
        cubic-bezier(0.18, 0.76, 0.28, 1)
        both;
}

.notebook-note-editor.is-page-revealing-forward {
    animation:
        notebook-page-reveal-forward
        680ms
        cubic-bezier(0.45, 0.05, 0.22, 1)
        both;
}

.notebook-note-editor.is-page-revealing-backward {
    animation:
        notebook-page-reveal-backward
        680ms
        cubic-bezier(0.45, 0.05, 0.22, 1)
        both;
}

.notebook-page-turn-snapshot {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;

    z-index: 3;

    width: 100%;

    margin: 0;

    background:
        linear-gradient(
            to right,
            transparent 0,
            transparent 43px,
            var(--divider-color) 43px,
            var(--divider-color) 44px,
            transparent 44px
        ),
        var(
            --panel-background,
            #efe5d5
        );

    overflow: hidden;

    backface-visibility: hidden;
    pointer-events: none;
    transform-style: preserve-3d;
}

.notebook-page-turn-snapshot.is-turning-forward {
    transform-origin: left center;

    animation:
        notebook-page-turn-forward
        680ms
        cubic-bezier(0.45, 0.05, 0.22, 1)
        both;
}

.notebook-page-turn-snapshot.is-turning-backward {
    transform-origin: left center;

    animation:
        notebook-page-turn-backward
        680ms
        cubic-bezier(0.45, 0.05, 0.22, 1)
        both;
}

.notebook-note-editor
> .notebook-page-turn-shade {
    position: absolute;
    inset: 0;

    z-index: 4;

    border-radius: inherit;

    background:
        linear-gradient(
            to left,
            rgba(255, 255, 255, 0.32),
            transparent 28%,
            rgba(0, 0, 0, 0.05) 70%,
            rgba(0, 0, 0, 0.28)
        );

    content: "";
    opacity: 0;
    pointer-events: none;
}

.notebook-note-editor
> .notebook-page-turn-curl {
    position: absolute;
    top: -2px;
    right: -2px;
    bottom: -2px;

    z-index: 5;

    width: 34%;

    border-left:
        1px solid
        rgba(0, 0, 0, 0.12);

    border-radius:
        58% 12px 12px 58% /
        8% 12px 12px 8%;

    background:
        linear-gradient(
            to left,
            var(
                --panel-background,
                #efe5d5
            ) 0 7%,
            rgba(255, 255, 255, 0.66) 18%,
            rgba(0, 0, 0, 0.18) 38%,
            rgba(255, 255, 255, 0.42) 58%,
            transparent 88%
        );

    box-shadow:
        -9px 0 15px
        rgba(0, 0, 0, 0.12);

    pointer-events: none;
    transform-origin: right center;
}

.notebook-page-turn-snapshot.is-turning-forward
.notebook-page-turn-shade,
.notebook-page-turn-snapshot.is-turning-backward
.notebook-page-turn-shade {
    animation:
        notebook-page-fold-shade
        680ms
        ease-in-out
        both;
}

.notebook-page-turn-snapshot.is-turning-backward
.notebook-page-turn-shade {
    transform: scaleX(-1);
}

.notebook-page-turn-snapshot.is-turning-forward
.notebook-page-turn-curl {
    animation:
        notebook-page-curl-forward
        680ms
        cubic-bezier(0.45, 0.05, 0.22, 1)
        both;
}

.notebook-page-turn-snapshot.is-turning-backward
.notebook-page-turn-curl {
    animation:
        notebook-page-curl-backward
        680ms
        cubic-bezier(0.45, 0.05, 0.22, 1)
        both;
}

@keyframes notebook-page-arrive {
    0% {
        opacity: 1;

        transform:
            translateX(12px)
            rotateY(-7deg)
            scaleX(0.985);
    }

    100% {
        opacity: 1;
        transform: none;
    }
}

@keyframes notebook-page-reveal-forward {
    0%,
    38% {
        opacity: 1;

        transform:
            translateX(2px)
            scaleX(0.997);
    }

    100% {
        opacity: 1;
        transform: none;
    }
}

@keyframes notebook-page-reveal-backward {
    0%,
    38% {
        opacity: 1;

        transform:
            translateX(-2px)
            scaleX(0.997);
    }

    100% {
        opacity: 1;
        transform: none;
    }
}

@keyframes notebook-page-turn-forward {
    0% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                100% 0,
                100% 100%,
                0 100%
            );

        filter: brightness(1);

        transform:
            translateZ(2px)
            rotateY(0deg)
            skewY(0deg)
            scaleX(1);
    }

    42% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                96% 1%,
                100% 7%,
                98% 28%,
                100% 50%,
                98% 72%,
                100% 93%,
                96% 99%,
                0 100%
            );

        border-radius:
            7px 38px 38px 7px /
            7px 22px 22px 7px;

        filter: brightness(0.94);

        transform:
            translateZ(16px)
            rotateY(-48deg)
            skewY(-0.5deg)
            scaleX(0.99);

        box-shadow:
            24px 7px 28px
            rgba(0, 0, 0, 0.22);
    }

    76% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                91% 2%,
                100% 12%,
                95% 31%,
                100% 50%,
                95% 69%,
                100% 88%,
                91% 98%,
                0 100%
            );

        border-radius:
            7px 76px 76px 7px /
            7px 34px 34px 7px;

        filter: brightness(0.82);

        transform:
            translateZ(8px)
            rotateY(-82deg)
            skewY(-0.9deg)
            scaleX(0.975);

        box-shadow:
            34px 9px 38px
            rgba(0, 0, 0, 0.3);
    }

    100% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                87% 3%,
                100% 16%,
                93% 34%,
                100% 50%,
                93% 66%,
                100% 84%,
                87% 97%,
                0 100%
            );

        border-radius:
            7px 110px 110px 7px /
            7px 44px 44px 7px;

        filter: brightness(0.72);

        transform:
            translateX(-3px)
            rotateY(-98deg)
            skewY(-1deg)
            scaleX(0.965);
    }
}

@keyframes notebook-page-turn-backward {
    0% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                100% 0,
                100% 100%,
                0 100%
            );

        filter: brightness(1);

        transform:
            translateZ(2px)
            rotateY(0deg)
            skewY(0deg)
            scaleX(1);
    }

    42% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                96% 1%,
                100% 7%,
                98% 28%,
                100% 50%,
                98% 72%,
                100% 93%,
                96% 99%,
                0 100%
            );

        border-radius:
            7px 38px 38px 7px /
            7px 22px 22px 7px;

        filter: brightness(0.94);

        transform:
            translateZ(16px)
            rotateY(48deg)
            skewY(0.5deg)
            scaleX(0.99);

        box-shadow:
            -24px 7px 28px
            rgba(0, 0, 0, 0.22);
    }

    76% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                91% 2%,
                100% 12%,
                95% 31%,
                100% 50%,
                95% 69%,
                100% 88%,
                91% 98%,
                0 100%
            );

        border-radius:
            7px 76px 76px 7px /
            7px 34px 34px 7px;

        filter: brightness(0.82);

        transform:
            translateZ(8px)
            rotateY(82deg)
            skewY(0.9deg)
            scaleX(0.975);

        box-shadow:
            -34px 9px 38px
            rgba(0, 0, 0, 0.3);
    }

    100% {
        opacity: 1;

        clip-path:
            polygon(
                0 0,
                87% 3%,
                100% 16%,
                93% 34%,
                100% 50%,
                93% 66%,
                100% 84%,
                87% 97%,
                0 100%
            );

        border-radius:
            7px 110px 110px 7px /
            7px 44px 44px 7px;

        filter: brightness(0.72);

        transform:
            translateX(3px)
            rotateY(98deg)
            skewY(1deg)
            scaleX(0.965);
    }
}

@keyframes notebook-page-fold-shade {
    0% {
        opacity: 0;
    }

    46% {
        opacity: 0.64;
    }

    78% {
        opacity: 0.86;
    }

    100% {
        opacity: 0.42;
    }
}

@keyframes notebook-page-curl-forward {
    0% {
        transform:
            translateX(22%)
            rotateY(0deg)
            scaleX(0.08);
    }

    42% {
        transform:
            translateX(7%)
            rotateY(-24deg)
            skewY(-0.8deg)
            scaleX(0.76);
    }

    76% {
        transform:
            translateX(-4%)
            rotateY(-52deg)
            skewY(-1.6deg)
            scaleX(1.18);
    }

    100% {
        transform:
            translateX(-9%)
            rotateY(-72deg)
            skewY(-2deg)
            scaleX(0.72);
    }
}

@keyframes notebook-page-curl-backward {
    0% {
        transform:
            translateX(22%)
            rotateY(0deg)
            scaleX(0.08);
    }

    42% {
        transform:
            translateX(7%)
            rotateY(24deg)
            skewY(0.8deg)
            scaleX(0.76);
    }

    76% {
        transform:
            translateX(-4%)
            rotateY(52deg)
            skewY(1.6deg)
            scaleX(1.18);
    }

    100% {
        transform:
            translateX(-9%)
            rotateY(72deg)
            skewY(2deg)
            scaleX(0.72);
    }
}

@media (prefers-reduced-motion: reduce) {
    .notebook-note-editor.is-page-arriving,
    .notebook-note-editor.is-page-revealing-forward,
    .notebook-note-editor.is-page-revealing-backward,
    .notebook-page-turn-snapshot,
    .notebook-page-turn-shade,
    .notebook-page-turn-curl {
        animation: none;
    }
}

/*
 * Daha doğal defter sayfası geçişi
 */

.notebook-page-stage {
    perspective: 1800px;
}

.notebook-page-turn-snapshot {
    clip-path: none;
    filter: none;
}

.notebook-page-turn-snapshot.is-page-underlay {
    z-index: 1;

    animation: none;

    border-radius:
        7px
        13px
        13px
        7px;

    box-shadow:
        4px 4px 0
        var(--panel-background),
        5px 5px 0
        var(--divider-color),
        0 14px 28px
        rgba(0, 0, 0, 0.08);

    transform: none;
}

.notebook-page-turn-snapshot.is-turning-forward {
    animation:
        notebook-page-turn-natural-forward
        560ms
        cubic-bezier(0.4, 0, 0.2, 1)
        both;
}

.notebook-note-editor
> .notebook-page-turn-curl {
    width: 16%;

    border-left:
        1px solid
        rgba(0, 0, 0, 0.08);

    border-radius:
        46% 13px 13px 46% /
        5% 13px 13px 5%;

    background:
        linear-gradient(
            to left,
            var(
                --panel-background,
                #efe5d5
            ) 0 12%,
            rgba(255, 255, 255, 0.46) 29%,
            rgba(0, 0, 0, 0.1) 54%,
            rgba(255, 255, 255, 0.18) 72%,
            transparent 100%
        );

    box-shadow:
        -5px 0 10px
        rgba(0, 0, 0, 0.08);
}

.notebook-page-turn-snapshot.is-turning-forward
.notebook-page-turn-shade {
    animation:
        notebook-page-turn-natural-shade
        560ms
        ease-in-out
        both;
}

.notebook-page-turn-snapshot.is-turning-forward
.notebook-page-turn-curl {
    animation:
        notebook-page-turn-natural-curl
        560ms
        cubic-bezier(0.4, 0, 0.2, 1)
        both;
}

.notebook-note-editor.is-page-entering-backward {
    z-index: 4;

    background:
        linear-gradient(
            to right,
            transparent 0,
            transparent 43px,
            var(--divider-color) 43px,
            var(--divider-color) 44px,
            transparent 44px
        ),
        var(
            --panel-background,
            #efe5d5
        );

    backface-visibility: hidden;
    transform-origin: left center;

    animation:
        notebook-page-enter-from-left
        560ms
        cubic-bezier(0.22, 0.72, 0.2, 1)
        both;
}

.notebook-note-editor
> .notebook-page-incoming-curl {
    position: absolute;
    top: -1px;
    right: -1px;
    bottom: -1px;

    z-index: 5;

    width: 15%;

    border-left:
        1px solid
        rgba(0, 0, 0, 0.08);

    border-radius:
        50% 13px 13px 50% /
        5% 13px 13px 5%;

    background:
        linear-gradient(
            to left,
            var(
                --panel-background,
                #efe5d5
            ) 0 14%,
            rgba(255, 255, 255, 0.42) 31%,
            rgba(0, 0, 0, 0.1) 58%,
            transparent 100%
        );

    box-shadow:
        -6px 0 12px
        rgba(0, 0, 0, 0.1);

    pointer-events: none;
    transform-origin: right center;

    animation:
        notebook-page-entering-curl
        560ms
        cubic-bezier(0.22, 0.72, 0.2, 1)
        both;
}

@keyframes notebook-page-turn-natural-forward {
    0% {
        border-radius:
            7px
            13px
            13px
            7px;

        box-shadow:
            4px 4px 0
            var(--panel-background),
            5px 5px 0
            var(--divider-color),
            0 14px 28px
            rgba(0, 0, 0, 0.08);

        transform:
            translateZ(1px)
            rotateY(0deg)
            scaleX(1);
    }

    32% {
        border-radius:
            7px
            18px
            18px
            7px;

        box-shadow:
            12px 4px 18px
            rgba(0, 0, 0, 0.14);

        transform:
            translateZ(8px)
            rotateY(-18deg)
            scaleX(0.997);
    }

    68% {
        border-radius:
            7px
            26px
            26px
            7px;

        box-shadow:
            22px 6px 26px
            rgba(0, 0, 0, 0.2);

        transform:
            translateZ(12px)
            rotateY(-58deg)
            scaleX(0.988);
    }

    100% {
        border-radius:
            7px
            32px
            32px
            7px;

        box-shadow:
            28px 7px 32px
            rgba(0, 0, 0, 0.24);

        transform:
            translateZ(4px)
            rotateY(-92deg)
            scaleX(0.98);
    }
}

@keyframes notebook-page-turn-natural-shade {
    0% {
        opacity: 0;
    }

    45% {
        opacity: 0.18;
    }

    75% {
        opacity: 0.36;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes notebook-page-turn-natural-curl {
    0% {
        transform:
            translateX(25%)
            rotateY(0deg)
            scaleX(0.06);
    }

    38% {
        transform:
            translateX(10%)
            rotateY(-10deg)
            scaleX(0.56);
    }

    72% {
        transform:
            translateX(0)
            rotateY(-28deg)
            scaleX(1);
    }

    100% {
        transform:
            translateX(-4%)
            rotateY(-52deg)
            scaleX(0.58);
    }
}

@keyframes notebook-page-enter-from-left {
    0% {
        border-radius:
            7px
            32px
            32px
            7px;

        box-shadow:
            28px 7px 32px
            rgba(0, 0, 0, 0.24);

        transform:
            translateZ(4px)
            rotateY(-88deg)
            scaleX(0.98);
    }

    36% {
        border-radius:
            7px
            25px
            25px
            7px;

        box-shadow:
            22px 6px 26px
            rgba(0, 0, 0, 0.2);

        transform:
            translateZ(12px)
            rotateY(-54deg)
            scaleX(0.988);
    }

    72% {
        border-radius:
            7px
            18px
            18px
            7px;

        box-shadow:
            12px 4px 18px
            rgba(0, 0, 0, 0.14);

        transform:
            translateZ(8px)
            rotateY(-16deg)
            scaleX(0.997);
    }

    100% {
        border-radius:
            7px
            13px
            13px
            7px;

        box-shadow:
            4px 4px 0
            var(--panel-background),
            5px 5px 0
            var(--divider-color),
            0 14px 28px
            rgba(0, 0, 0, 0.08);

        transform: none;
    }
}

@keyframes notebook-page-entering-curl {
    0% {
        transform:
            translateX(-4%)
            rotateY(-52deg)
            scaleX(0.92);
    }

    42% {
        transform:
            translateX(0)
            rotateY(-30deg)
            scaleX(0.72);
    }

    76% {
        transform:
            translateX(10%)
            rotateY(-12deg)
            scaleX(0.38);
    }

    100% {
        transform:
            translateX(24%)
            rotateY(0deg)
            scaleX(0.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .notebook-note-editor.is-page-entering-backward,
    .notebook-page-turn-snapshot.is-turning-forward,
    .notebook-page-turn-shade,
    .notebook-page-turn-curl,
    .notebook-page-incoming-curl {
        animation: none;
    }
}

.notebook-note-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;
}

.notebook-note-editor-actions,
.notebook-note-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notebook-note-character-count {
    font-size: 13px;
    opacity: 0.62;
}

#save-notebook-note-button,
.notebook-page-snapshot-save-button,
.notebook-note-navigation-button {
    background: var(--surface-medium);
}

.notebook-note-navigation-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;

    border:
        1px solid
        var(--control-border-color);
    border-radius: 999px;

    color: inherit;

    cursor: pointer;
}

.notebook-note-navigation-button:hover:not(:disabled) {
    background:
        var(--interaction-hover-background);
}

.notebook-note-navigation-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.notebook-note-navigation-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.notebook-note-navigation-icon {
    display: block;

    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

@media (max-width: 520px) {
    .notebook-note-editor {
        padding:
            20px
            14px
            18px
            48px;
    }

    .notebook-note-editor::before {
        left: 18px;
    }

    .notebook-note-editor::after {
        left: 1px;
    }

    .notebook-note-primary-actions,
    .notebook-note-name-actions,
    .notebook-note-editor-footer,
    .notebook-note-editor-header {
        align-items: stretch;
        flex-direction: column;
    }

    #show-create-note-button,
    .notebook-note-name-actions button,
    #save-notebook-note-button,
    .notebook-page-snapshot-save-button {
        width: 100%;
    }

    .word-list-management-actions,
    .notebook-note-management-actions {
        grid-template-columns:
            minmax(0, 0.9fr)
            minmax(0, 1.35fr)
            minmax(0, 0.9fr);

        gap: 4px;
        margin-right: -2px;
        margin-left: -2px;
    }

    .word-list-management-actions {
        grid-template-columns:
            minmax(0, 1.05fr)
            minmax(0, 1.4fr)
            minmax(0, 0.95fr);

        margin-right: -3px;
        margin-left: -3px;
    }

    .word-list-management-actions button,
    .notebook-note-management-actions button,
    #show-create-list-button,
    #show-create-note-button {
        min-height: 44px;
        padding: 9px 2px;

        font-size: 12px;
    }

    #show-create-list-button,
    #show-create-note-button {
        gap: 3px;
    }

    .create-action-icon {
        width: 15px;
        height: 15px;
    }

    .word-list-management-actions button,
    #show-create-list-button {
        font-size: 13px;
    }

    .word-list-management-actions
    .create-action-icon {
        width: 16px;
        height: 16px;
    }

    .notebook-note-date {
        max-width: none;
        text-align: left;
    }

    .notebook-note-editor-actions {
        width: 100%;
    }

    .notebook-note-navigation {
        flex: 0 0 auto;
    }

    .notebook-note-editor-actions
    #save-notebook-note-button,
    .notebook-note-editor-actions
    .notebook-page-snapshot-save-button {
        min-width: 0;
        flex: 1;
    }

    #notebook-note-content,
    .notebook-page-snapshot-content {
        min-height: 220px;
    }
}

@media (max-width: 380px) {
    .word-list-management-actions button,
    .word-list-management-actions
    #show-create-list-button {
        font-size: 12px;
    }

    .word-list-management-actions
    .create-action-icon {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 370px) {
    .word-list-management-actions button,
    .word-list-management-actions
    #show-create-list-button {
        padding-right: 1px;
        padding-left: 1px;

        font-size: 11.5px;
    }

    .word-list-management-actions
    #show-create-list-button {
        gap: 2px;
    }

    .word-list-management-actions
    .create-action-icon {
        width: 14px;
        height: 14px;
    }
}

/*
 * Kategorili sözlük filtreleri
 */

.word-filters-intro {
    margin: 0 0 15px;
}

.word-filter-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 14px;
    padding: 13px 14px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 11px;
}

.word-filter-summary-label {
    font-size: 14px;
    opacity: 0.7;
}

#word-filter-summary {
    flex: 0 0 auto;

    font-size: 16px;
    font-weight: normal;
    font-variant-numeric:
        tabular-nums;
}

#word-filter-controls {
    display: grid;
    gap: 9px;
}

.word-filter-section {
    overflow: hidden;

    border:
        1px solid
        var(--control-border-color);
    border-radius: 11px;
}

.word-filter-section > summary,
.word-filter-domain-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 12px 14px;

    cursor: pointer;
    user-select: none;
}

.word-filter-section > summary {
    font-size: 16px;
}

.word-filter-section > summary:hover,
.word-filter-domain-group > summary:hover {
    background:
        var(--interaction-hover-background);
}

.word-filter-section > summary:focus-visible,
.word-filter-domain-group > summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}

.word-filter-section[open] > summary {
    border-bottom:
        1px solid
        var(--divider-color);
}

.word-filter-section-count {
    flex: 0 0 auto;

    font-size: 13px;
    font-variant-numeric:
        tabular-nums;
    opacity: 0.62;
}

#word-filter-type-options,
#word-filter-verb-form-options,
#word-filter-feature-options,
#word-filter-usage-options,
#word-filter-theme-options {
    padding: 13px 14px;
}

.word-theme-filter-section[open] > summary {
    background: var(--surface-soft);
}

.word-theme-option-grid {
    border-top:
        1px solid
        var(--divider-color);
}

.word-filter-option-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 9px 14px;
}

.word-filter-option-grid-wide {
    grid-template-columns: 1fr;
}

.word-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    min-width: 0;

    cursor: pointer;
}

.word-filter-option input,
.word-filter-domain-master input {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;
    margin: 2px 0 0;

    cursor: pointer;
}

.word-filter-option-text {
    display: grid;
    gap: 2px;

    min-width: 0;
}

.word-filter-option-name {
    font-size: 14px;
    line-height: 1.3;
}

.word-filter-option-text small {
    font-size: 12px;
    line-height: 1.3;
    opacity: 0.62;
}

.word-filter-section-help {
    margin: 13px 14px 0;

    font-size: 13px;
    line-height: 1.42;
    opacity: 0.7;
}

.word-filter-section-help:last-child {
    margin-bottom: 14px;
}

.word-filter-subgroup +
.word-filter-subgroup {
    border-top:
        1px solid
        var(--divider-color);
}

.word-filter-subgroup h4 {
    padding: 13px 14px 0;

    font-size: 13px;
    font-weight: normal;
    opacity: 0.68;
}

.word-filter-domain-options {
    display: grid;
    gap: 8px;

    padding: 13px 14px 14px;
}

.word-filter-domain-master {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    padding: 10px 11px;

    background: var(--surface-soft);
    border-radius: 9px;

    cursor: pointer;
}

.word-filter-domain-master span {
    font-size: 14px;
    line-height: 1.35;
}

.word-filter-domain-group {
    overflow: hidden;

    border:
        1px solid
        var(--divider-color);
    border-radius: 9px;
}

.word-filter-domain-group > summary {
    padding: 10px 11px;

    font-size: 14px;
}

.word-filter-domain-group[open] > summary {
    border-bottom:
        1px solid
        var(--divider-color);
}

.word-filter-domain-group-body {
    display: grid;
    gap: 12px;

    padding: 11px;
}

.word-filter-reset-button {
    margin-top: 12px;
}

@media (max-width: 520px) {
    .settings-category-body {
        padding: 13px;
    }

    .word-filter-summary-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .word-filter-option-grid {
        grid-template-columns: 1fr;
    }
}

.word-filter-option.is-family-friendly-disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.word-filter-option.is-family-friendly-disabled input,
.word-filter-option.is-family-friendly-disabled
    .word-filter-option-text {
    cursor: not-allowed;
}

.is-family-friendly-hidden-word {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;

    line-height: 1;
}

.family-friendly-lock-icon {
    display: block;

    width: 1em;
    height: 1em;

    overflow: visible;

    color: inherit;

    pointer-events: none;
}

.family-friendly-lock-shackle,
.family-friendly-lock-body,
.family-friendly-lock-keyhole-line {
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;
}

.family-friendly-lock-shackle,
.family-friendly-lock-keyhole-line {
    fill: none;
}

.family-friendly-lock-body {
    fill:
        var(
            --family-friendly-lock-fill,
            var(--panel-background)
        );
}

.family-friendly-lock-keyhole {
    fill: currentColor;
}

.pinned-word-label.is-family-friendly-hidden-word {
    --family-friendly-lock-fill:
        var(--page-background);
}

.selected-word-text.is-family-friendly-hidden-word,
.search-result-word.is-family-friendly-hidden-word {
    --family-friendly-lock-fill:
        var(--panel-background);
}

.confirmation-preference[hidden] {
    display: none;
}

/* Mobilde kelimeye uzun basarken metin seçimini engeller. */
.word,
.word-label {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.word {
    -webkit-tap-highlight-color: transparent;
}

.modal-actions button[hidden] {
    display: none;
}

/* Uygulama arayüzünde uzun basmayla metin seçimini
   engeller; gerçek metin girişlerinde seçime izin verir. */
body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input:not([type]),
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
[contenteditable="true"],
[contenteditable="plaintext-only"] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

@media (orientation: landscape) and (max-height: 650px) {
    #selected-words-overlay {
        display: block;

        overflow-y: auto;
        overscroll-behavior-y: contain;
        touch-action: pan-y;

        -webkit-overflow-scrolling: touch;
    }

    .selected-words-panel {
        width: 100%;
        max-height: none;

        margin: 0 auto;

        overflow: visible;
    }
}

/* Yatay mobilde Duraklat düğmesini başlığın içinde ortalar. */
@media (orientation: landscape) and (max-height: 650px) {
    #animation-toggle-button {
        position: absolute;

        left: 50%;
        top: 50%;

        transform: translate(-50%, -50%);
    }
}

@media (orientation: landscape) and (max-height: 650px) {
    #animation-toggle-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;

        padding: 0;
    }
}

/*
 * Mobil menüde Notlar sayacı başlığın
 * hemen yanında kalsın.
 */
@media
    (max-width: 700px),
    (orientation: landscape)
    and (max-height: 600px) {

    #toolbar-menu-primary-actions
    #notes-button
    .toolbar-button-detail {
        flex: 0 0 auto;

        margin-left: 0;
        padding-right: 0;

        overflow: visible;
    }
}

/*
 * Ana uygulama sayfası kaydırılmaz.
 * Özellikle iOS Safari'nin yenileme sonrası
 * kök scroll/viewport konumunu geri yüklemesini
 * engeller.
 */
html {
    width: 100%;
    height: 100%;

    overflow: hidden;
    overscroll-behavior: none;
}

/*
 * Listelerim ve Notlar ekranları yalnızca dikey kaydırılır.
 * Bu kural dosyanın sonunda tutularak yatay mobildeki
 * `overflow: visible` ayarının yatay taşmayı yeniden açması engellenir.
 */
#selected-words-overlay,
#notes-overlay,
.selected-words-panel,
.notes-panel {
    max-width: 100%;

    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
}

/*
 * Hesap, üyelik ve bulut yedeği
 */

#membership-overlay {
    position: fixed;
    inset: 0;
    z-index: 190;

    display: grid;
    place-items: center;

    padding:
        max(18px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(18px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));

    overflow-y: auto;
    overscroll-behavior: contain;

    background: rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(4px);
}

#membership-overlay[hidden],
.membership-view[hidden],
.membership-auth-form[hidden],
.membership-plan-card button[hidden],
.membership-cloud-card[hidden],
.membership-loading[hidden] {
    display: none;
}

.membership-panel {
    width: min(640px, 100%);
    max-height: min(820px, 92dvh);

    padding: 28px;
    overflow-y: auto;
    overscroll-behavior: contain;

    background:
        var(
            --panel-background,
            #efe5d5
        );

    border:
        1px solid
        var(--panel-border-color);

    border-radius: 20px;

    color: var(--text-color);

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.34);
}

.membership-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;
    margin-bottom: 20px;
}

.membership-eyebrow,
.membership-plan-kicker {
    margin-bottom: 5px;

    color: var(--theme-word-color);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.membership-header h2 {
    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 29px;
    font-weight: 600;
    line-height: 1.14;
}

.membership-loading {
    min-height: 140px;

    display: grid;
    place-items: center;

    font-size: 15px;
    opacity: 0.68;
}

.membership-view {
    display: grid;
    gap: 16px;
}

.membership-hero,
.membership-account-card,
.membership-plan-card,
.membership-cloud-card,
.membership-benefits {
    border:
        1px solid
        var(--divider-color);

    border-radius: 15px;
}

.membership-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;

    gap: 15px;
    padding: 18px;

    background: var(--surface-medium);
}

.membership-hero-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    background: var(--surface-soft);
    border-radius: 50%;

    color: var(--theme-word-color);
    font-size: 27px;
}

.membership-hero h3,
.membership-benefits h3,
.membership-plan-card h3,
.membership-cloud-card h3 {
    margin-bottom: 6px;

    font-size: 19px;
    font-weight: 700;
}

.membership-hero p,
.membership-plan-card p,
.membership-cloud-card p {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.72;
}

.membership-benefits {
    padding: 18px;

    background: var(--surface-soft);
}

.membership-comparison {
    display: grid;
    gap: 13px;
}

.local-premium-preview {
    display: grid;
    gap: 13px;

    padding: 17px;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 10%,
            var(--surface-soft)
        );

    border:
        1px dashed
        color-mix(
            in srgb,
            var(--theme-word-color) 55%,
            var(--divider-color)
        );

    border-radius: 14px;
}

.local-premium-preview h3 {
    margin-bottom: 5px;

    font-size: 18px;
    font-weight: 700;
}

.local-premium-preview p {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.72;
}

.local-premium-preview
.membership-secondary-button {
    justify-self: start;
}

.local-premium-preview-safety {
    padding-top: 10px;

    border-top:
        1px solid
        var(--divider-color);

    font-size: 11px !important;
    opacity: 0.58 !important;
}

.local-premium-preview-studio {
    min-width: 0;

    display: grid;
    gap: 13px;

    padding-top: 14px;

    border-top:
        1px solid
        var(--divider-color);
}

.local-premium-preview-studio[hidden] {
    display: none;
}

.local-premium-preview-studio > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;
}

.local-premium-preview-studio > header h3 {
    margin: 0;
}

.local-preview-badge {
    flex: 0 0 auto;

    padding: 6px 9px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--divider-color);
    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

.local-preview-feature-tabs {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 6px;
    padding: 5px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 12px;
}

.local-preview-feature-tabs button {
    min-width: 0;
    min-height: 46px;
    padding: 7px 8px;

    background: transparent;
    border:
        1px solid
        transparent;
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 11px;
    line-height: 1.25;

    cursor: pointer;
}

.local-preview-feature-tabs
button[aria-selected="true"] {
    background: var(--surface-medium);
    border-color:
        color-mix(
            in srgb,
            var(--theme-word-color) 42%,
            var(--control-border-color)
        );

    color: var(--theme-word-color);
    font-weight: 700;

    box-shadow:
        0 4px 12px
        rgba(0, 0, 0, 0.08);
}

.local-preview-feature-tabs
button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.local-preview-feature-content {
    min-width: 0;

    display: grid;
    gap: 12px;

    padding: 15px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--divider-color);
    border-radius: 13px;
}

.local-preview-demo-copy {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;

    gap: 11px;
}

.local-preview-demo-copy h4 {
    margin-bottom: 4px;

    font-size: 16px;
}

.local-preview-demo-copy p {
    font-size: 12px;
    line-height: 1.45;
    opacity: 0.7;
}

.local-preview-demo-number {
    width: 31px;
    height: 31px;

    display: grid;
    place-items: center;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 13%,
            var(--surface-soft)
        );
    border-radius: 50%;

    color: var(--theme-word-color);
    font-size: 11px;
    font-weight: 800;
}

.local-preview-field {
    min-width: 0;

    display: grid;
    gap: 6px;

    font-size: 12px;
    font-weight: 650;
}

.local-preview-field input,
.local-preview-field select {
    width: 100%;
    min-width: 0;
    min-height: 42px;

    padding: 8px 10px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    font-size: 14px;
}

.local-preview-pair-fields {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.local-preview-example-query {
    display: grid;
    gap: 7px;

    padding: 13px;

    background: var(--surface-soft);
    border:
        1px dashed
        var(--divider-color);
    border-radius: 10px;
}

.local-preview-example-query > span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.58;
}

.local-preview-example-query strong {
    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 16px;
    font-weight: 600;
}

.local-preview-example-query > div {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}

.local-preview-example-query i {
    padding: 5px 9px;

    background: var(--surface-medium);
    border-radius: 999px;

    font-size: 11px;
    font-style: normal;
}

.local-preview-output {
    min-height: 55px;

    display: grid;
    align-content: center;
    gap: 5px;

    padding: 12px;

    background: var(--surface-soft);
    border:
        1px dashed
        var(--divider-color);
    border-radius: 10px;

    font-size: 12px;
    line-height: 1.45;
    opacity: 0.78;
}

.local-preview-output > span,
.local-preview-output > small {
    display: block;
}

.local-preview-output > small {
    font-size: 10px;
    opacity: 0.72;
}

.local-preview-flow-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.local-preview-flow-actions
button[hidden] {
    display: none;
}

.local-preview-output.is-smart-flow-ready {
    align-content: stretch;
    gap: 12px;

    padding: 0;

    background: transparent;
    border: 0;

    opacity: 1;
}

.local-preview-smart-flow-summary {
    display: grid;
    gap: 4px;

    padding: 12px 13px;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 10%,
            var(--surface-soft)
        );
    border:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 30%,
            var(--divider-color)
        );
    border-radius: 11px;
}

.local-preview-smart-flow-summary strong {
    font-family:
        "Fraunces",
        Georgia,
        serif;
    font-size: 16px;
    font-weight: 650;
}

.local-preview-smart-flow-summary > span {
    color: var(--theme-word-color);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.local-preview-smart-flow-summary p {
    margin-top: 4px;

    font-size: 11px;
    line-height: 1.4;
    opacity: 0.68;
}

.local-preview-smart-flow-stages {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;
}

.local-preview-smart-flow-stages article {
    min-width: 0;

    display: grid;
    align-content: start;
    gap: 10px;

    padding: 11px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 10px;
}

.local-preview-smart-flow-stages
article > div:first-child {
    min-width: 0;

    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;

    gap: 7px;
}

.local-preview-smart-flow-stages
article > div:first-child > span {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 13%,
            var(--surface-medium)
        );
    border-radius: 50%;

    color: var(--theme-word-color);
    font-size: 9px;
    font-weight: 800;
}

.local-preview-smart-flow-stages
article > div:first-child > div {
    min-width: 0;

    display: grid;
    gap: 2px;
}

.local-preview-smart-flow-stages
article strong {
    font-size: 12px;
}

.local-preview-smart-flow-stages
article small {
    font-size: 9px;
    line-height: 1.35;
    opacity: 0.58;
}

.local-preview-smart-flow-words {
    display: flex;
    flex-wrap: wrap;

    gap: 5px;
}

.local-preview-smart-flow-words span {
    padding: 5px 7px;

    background: var(--surface-medium);
    border:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 22%,
            var(--divider-color)
        );
    border-radius: 999px;

    font-size: 10px;
    font-weight: 650;
}

.local-preview-smart-flow-note {
    display: block;

    padding-top: 2px;

    font-size: 9px;
    line-height: 1.4;
    opacity: 0.52;
}

.local-preview-word-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 6px;
}

.local-preview-word-line span {
    padding: 6px 9px;

    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 11%,
            var(--surface-medium)
        );
    border:
        1px solid
        color-mix(
            in srgb,
            var(--theme-word-color) 28%,
            var(--divider-color)
        );
    border-radius: 999px;

    font-size: 12px;
    font-weight: 650;
}

.local-preview-word-line b {
    color: var(--theme-word-color);
    font-weight: 500;
}

.local-preview-device-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.local-preview-device-list article {
    min-width: 0;

    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;

    gap: 9px;
    padding: 11px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 10px;
}

.local-preview-device-list article > span {
    font-size: 22px;
    color: var(--theme-word-color);
}

.local-preview-device-list article > div {
    min-width: 0;

    display: grid;
    gap: 2px;
}

.local-preview-device-list strong,
.local-preview-device-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.local-preview-device-list strong {
    font-size: 12px;
}

.local-preview-device-list small {
    font-size: 10px;
    opacity: 0.62;
}

.local-preview-history-list {
    display: grid;
    gap: 6px;
}

.local-preview-history-list button {
    min-width: 0;
    padding: 10px 11px;

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

    gap: 12px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 9px;

    color: inherit;
    font: inherit;
    text-align: left;

    cursor: pointer;
}

.local-preview-history-list
button.is-selected {
    border-color:
        var(--theme-word-color);

    box-shadow:
        inset 3px 0
        var(--theme-word-color);
}

.local-preview-history-list span {
    font-size: 12px;
    font-weight: 650;
}

.local-preview-history-list small {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 10px;
    opacity: 0.6;
}

.word-insight-card[data-state="preview"] {
    border-style: dashed;
}

.word-insight-card[data-state="daily-free"] {
    box-shadow:
        inset 3px 0
        var(--theme-word-color),
        0 8px 24px
        color-mix(
            in srgb,
            var(--theme-word-color) 8%,
            transparent
        );
}

.membership-comparison-intro {
    display: grid;
    gap: 5px;
}

.membership-comparison-intro h3 {
    font-size: 18px;
    font-weight: 700;
}

.membership-comparison-intro p {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.7;
}

.membership-comparison-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

.membership-comparison-grid > article {
    padding: 17px;

    background: var(--surface-soft);

    border:
        1px solid
        var(--divider-color);

    border-radius: 14px;
}

.membership-comparison-grid
> article.is-premium {
    border-color:
        color-mix(
            in srgb,
            var(--theme-word-color) 48%,
            var(--divider-color)
        );

    box-shadow:
        inset 3px 0
        var(--theme-word-color);
}

.membership-comparison-grid h4 {
    margin-bottom: 9px;

    font-size: 17px;
}

.membership-comparison-grid ul {
    display: grid;
    gap: 6px;

    margin: 0;
    padding-left: 19px;

    font-size: 13px;
    line-height: 1.42;
}

.premium-feature-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;
}

.premium-feature-card {
    padding: 13px;

    background: var(--surface-medium);

    border:
        1px solid
        var(--divider-color);

    border-radius: 11px;
}

.premium-feature-card h4 {
    margin-bottom: 4px;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.premium-feature-card p {
    font-size: 12px;
    line-height: 1.45;
    opacity: 0.68;
}

.premium-feature-grid.is-compact {
    grid-template-columns: 1fr;
}

.premium-feature-grid.is-compact
.premium-feature-card {
    padding: 11px 13px;
}

.membership-benefits ul {
    display: grid;
    gap: 9px;

    padding-left: 21px;

    font-size: 14px;
    line-height: 1.45;
}

.membership-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    padding: 4px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 12px;
}

.membership-auth-tabs button {
    min-height: 42px;
    padding: 8px 12px;

    background: transparent;
    border: 0;
    border-radius: 9px;

    color: inherit;
    font: inherit;

    cursor: pointer;
}

.membership-auth-tabs
button[aria-selected="true"] {
    background: var(--surface-medium);

    box-shadow:
        0 3px 12px
        rgba(0, 0, 0, 0.1);

    font-weight: 700;
}

.membership-auth-form {
    display: grid;
    gap: 13px;

    padding: 18px;

    border:
        1px solid
        var(--divider-color);
    border-radius: 15px;
}

.membership-auth-form > label:not(.membership-consent-row) {
    display: grid;
    gap: 6px;

    font-size: 14px;
    font-weight: 650;
}

.membership-auth-form input[type="email"],
.membership-auth-form input[type="password"] {
    width: 100%;
    min-height: 46px;

    padding: 10px 12px;

    background: var(--surface-medium);
    border:
        1px solid
        var(--control-border-color);
    border-radius: 10px;

    color: inherit;
    font: inherit;
    font-size: 16px;
}

.membership-consent-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;

    gap: 9px;

    font-size: 13px;
    line-height: 1.45;
    opacity: 0.78;
}

.membership-consent-row input {
    width: 18px;
    height: 18px;

    margin-top: 1px;
}

.membership-primary-button,
.membership-secondary-button,
.membership-link-button {
    min-height: 44px;
    padding: 10px 16px;

    border-radius: 999px;

    color: inherit;
    font: inherit;
    font-weight: 650;

    cursor: pointer;
}

.membership-primary-button {
    background: var(--theme-word-color);
    border:
        1px solid
        var(--theme-word-color);

    color: var(--page-background);
}

.membership-secondary-button {
    background: transparent;
    border:
        1px solid
        var(--control-border-color);
}

.membership-link-button {
    min-height: 38px;
    padding: 6px 10px;

    background: transparent;
    border-color: transparent;

    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.74;
}

.membership-primary-button:hover,
.membership-secondary-button:hover,
.membership-link-button:hover {
    filter: brightness(1.05);
}

.membership-primary-button:focus-visible,
.membership-secondary-button:focus-visible,
.membership-link-button:focus-visible,
.membership-auth-tabs button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.membership-privacy-note {
    font-size: 13px;
    line-height: 1.48;
    opacity: 0.62;
}

.membership-account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
    padding: 16px 18px;

    background: var(--surface-medium);
}

.membership-account-card > div {
    min-width: 0;

    display: grid;
    gap: 3px;
}

.membership-account-label {
    font-size: 12px;
    opacity: 0.58;
}

#membership-account-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 15px;
}

.membership-status-badge {
    flex: 0 0 auto;

    padding: 7px 11px;

    background: var(--surface-soft);
    border:
        1px solid
        var(--divider-color);
    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
}

.membership-status-badge[data-premium="true"] {
    background:
        color-mix(
            in srgb,
            var(--theme-word-color) 15%,
            transparent
        );

    border-color:
        color-mix(
            in srgb,
            var(--theme-word-color) 42%,
            transparent
        );

    color: var(--theme-word-color);
}

.membership-plan-card,
.membership-cloud-card {
    display: grid;
    gap: 14px;

    padding: 19px;

    background: var(--surface-soft);
}

.membership-plan-card
.membership-primary-button,
.membership-plan-card
.membership-secondary-button {
    width: 100%;
}

.membership-cloud-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;
}

.membership-cloud-status {
    min-height: 20px;

    font-size: 13px;
    font-weight: 650;
    opacity: 0.72;
}

.membership-sign-out-button {
    justify-self: start;
}

.membership-form-status {
    min-height: 20px;
    margin-top: 13px;

    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
}

.membership-form-status:empty {
    min-height: 0;
    margin-top: 0;
}

.membership-form-status[data-type="success"] {
    color: var(--toast-success-color);
}

.membership-form-status[data-type="warning"] {
    color: var(--toast-warning-color);
}

.membership-form-status[data-type="error"] {
    color: var(--danger-color);
}

#membership-button.is-premium {
    border-color:
        color-mix(
            in srgb,
            var(--theme-word-color) 58%,
            transparent
        );
}

@media (max-width: 560px) {
    #membership-overlay {
        display: block;

        padding:
            max(10px, env(safe-area-inset-top))
            max(10px, env(safe-area-inset-right))
            max(10px, env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left));
    }

    .membership-panel {
        width: 100%;
        max-height: none;

        padding: 21px 17px;

        border-radius: 17px;
    }

    .membership-header h2 {
        font-size: 25px;
    }

    .membership-account-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .membership-cloud-actions {
        grid-template-columns: 1fr;
    }

    .membership-comparison-grid,
    .premium-feature-grid {
        grid-template-columns: 1fr;
    }

    .local-premium-preview-studio > header {
        align-items: stretch;
        flex-direction: column;
    }

    .local-preview-badge {
        align-self: flex-start;
    }

    .local-preview-feature-tabs {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .local-preview-pair-fields,
    .local-preview-device-list {
        grid-template-columns: 1fr;
    }

    .local-preview-flow-actions,
    .local-preview-smart-flow-stages {
        grid-template-columns: 1fr;
    }

    .local-preview-history-list button {
        align-items: flex-start;
        flex-direction: column;

        gap: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #membership-overlay {
        backdrop-filter: none;
    }
}
