/* Folded alchemy notes and the one-off synthesis draft. (Floating FAB at bottom-right) */
.alchemy-note-shell {
    position: fixed;
    right: clamp(1rem, 2.5vw, 2.5rem);
    bottom: clamp(1.2rem, 2.5vw, 2.5rem);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    min-width: 0;
    margin: 0;
}

.alchemy-note-shell[hidden],
.alchemy-note-popover[hidden],
.alchemy-quickboard-panel[hidden],
.alchemy-note-count[hidden],
.alchemy-note-draft-badge[hidden],
.alchemy-note-card-details[hidden] {
    display: none !important;
}

.alchemy-note-launcher,
.alchemy-note-close,
.alchemy-note-add-item,
.alchemy-note-save-step,
.alchemy-note-delete,
.quick-slot-move,
.quick-slot-remove,
.primary-button,
.text-button {
    border: 1px solid transparent;
    border-radius: var(--radius-ctrl);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    letter-spacing: 0;
}

.alchemy-note-launcher {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.45rem;
    padding: 0.42rem 1.05rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alchemy-note-launcher:hover,
.alchemy-note-launcher:focus-visible,
.alchemy-note-shell.is-open .alchemy-note-launcher {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
    outline: none;
}

.alchemy-note-launcher.launcher-bounce {
    animation: launcherBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes launcherBounce {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.18) translateY(-4px); }
    70% { transform: scale(0.95); }
}

.alchemy-note-launcher-icon {
    flex: 0 0 auto;
    color: var(--accent-gold);
    display: inline-grid;
    place-items: center;
}

.alchemy-note-count,
.alchemy-note-draft-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.25rem;
    padding: 0.08rem 0.36rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.alchemy-note-count {
    background: rgba(202, 138, 4, 0.12);
    color: var(--accent-gold);
}

.alchemy-note-draft-badge {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.alchemy-note-popover {
    pointer-events: auto;
    position: fixed;
    top: auto;
    bottom: calc(clamp(1.2rem, 2.5vw, 2.5rem) + 3.4rem);
    right: clamp(1rem, 2.5vw, 2.5rem);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    width: min(30rem, calc(100vw - 2rem));
    max-height: min(40rem, calc(100dvh - 7.5rem));
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--overlay-bg);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
    animation: fadeInUpPopover 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUpPopover {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Subtle brand gradient along the top edge — replaces the former hard 3px gold bar. */
.alchemy-note-popover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--primary-color) 55%, transparent 100%);
    opacity: 0.85;
    pointer-events: none;
}

.alchemy-note-popover-header {
    flex: 0 0 auto;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid var(--subtle-divider);
    background: transparent;
}

.alchemy-quickboard-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 0 0 auto;
    gap: 0.25rem;
    margin: 0.6rem 1rem 0;
    padding: 0.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--bg-inset);
}

.alchemy-quickboard-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-width: 0;
    min-height: 2rem;
    padding: 0.3rem 0.65rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.alchemy-quickboard-tab:hover,
.alchemy-quickboard-tab:focus-visible {
    color: var(--text-main);
    outline: none;
}

.alchemy-quickboard-tab.is-active,
.alchemy-quickboard-tab[aria-selected="true"] {
    background: var(--bg-card);
    color: var(--primary-strong);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .alchemy-quickboard-tab.is-active,
html[data-theme="dark"] .alchemy-quickboard-tab[aria-selected="true"] {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.alchemy-quickboard-tab-count {
    display: inline-flex;
    align-items: center;
    min-height: 1.2rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.67rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.alchemy-quickboard-panel {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.alchemy-note-eyebrow {
    display: block;
    color: var(--accent-gold);
    font-size: 0.68rem;
    font-weight: 700;
}

.alchemy-note-popover-header h2 {
    margin: 0.08rem 0 0;
    font-size: 1rem;
}

.alchemy-note-close,
.alchemy-note-delete,
.quick-slot-move,
.quick-slot-remove {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.85rem;
    height: 1.85rem;
    border-color: var(--border-color);
    color: var(--text-muted);
    line-height: 1;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.alchemy-note-close svg,
.alchemy-note-delete svg,
.quick-slot-remove svg,
.quick-slot-move svg {
    display: block;
}

.alchemy-note-close:hover,
.alchemy-note-close:focus-visible,
.alchemy-note-delete:hover,
.alchemy-note-delete:focus-visible,
.quick-slot-remove:hover,
.quick-slot-remove:focus-visible {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(220, 38, 38, 0.06);
    outline: none;
}

.alchemy-note-close:hover svg,
.alchemy-note-delete:hover svg,
.quick-slot-remove:hover svg {
    transform: rotate(90deg);
}

.alchemy-note-close svg,
.alchemy-note-delete svg,
.quick-slot-remove svg {
    transition: transform 0.18s ease;
}

.alchemy-note-saved-section,
.alchemy-note-draft-section {
    flex: 1 1 auto;
    padding: 0.85rem 1rem 0.95rem;
}

.alchemy-note-draft-section {
    background: transparent;
}

.alchemy-note-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.58rem;
}

.alchemy-note-section-heading h3 {
    margin: 0;
    font-size: 0.84rem;
}

.text-button {
    padding: 0.12rem 0.25rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.text-button:hover,
.text-button:focus-visible {
    color: var(--danger);
    outline: none;
}

.alchemy-note-saved-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alchemy-note-saved-empty,
.alchemy-note-draft-empty {
    padding: 0.85rem 0.7rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-inset);
    color: var(--text-muted);
    font-size: 0.76rem;
    text-align: center;
}

.alchemy-note-card {
    position: relative;
    padding: 0.72rem 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

/* Subtle gold-to-transparent gradient along the top edge — replaces the former hard left gold bar. */
.alchemy-note-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--accent-gold) 0%, transparent 65%);
    opacity: 0.7;
    pointer-events: none;
}

.alchemy-note-card:hover,
.alchemy-note-card:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
    outline: none;
}

html[data-theme="dark"] .alchemy-note-card:hover,
html[data-theme="dark"] .alchemy-note-card:focus-visible {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.alchemy-note-card.is-expanded {
    border-color: var(--primary-color);
    background: var(--panel-inset-bg);
    box-shadow: none;
    transform: none;
}

.alchemy-note-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.alchemy-note-card-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.22rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.3;
}

.alchemy-route-card .alchemy-note-card-label {
    background: rgba(202, 138, 4, 0.14);
    color: var(--accent-gold);
}

html[data-theme="dark"] .alchemy-route-card .alchemy-note-card-label {
    background: rgba(245, 165, 36, 0.16);
}

.alchemy-note-card h4 {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
}

.alchemy-note-formula {
    margin-top: 0.42rem;
    color: var(--text-main);
    font-size: 0.79rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.alchemy-note-output-meta,
.alchemy-note-sources {
    margin-top: 0.24rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.alchemy-note-output-names {
    margin-top: 0.25rem;
    color: var(--primary-strong);
    font-size: 0.74rem;
    line-height: 1.45;
}

.alchemy-note-expand-hint {
    display: block;
    margin-top: 0.34rem;
    color: var(--text-muted);
    font-size: 0.66rem;
    text-align: right;
}

.alchemy-note-card-details {
    margin-top: 0.55rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--subtle-divider);
}

.alchemy-note-detail-table-wrap,
.alchemy-quickboard-results-wrap {
    max-height: 18rem;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
    border: 1px solid var(--table-border);
    border-radius: 8px;
}

.alchemy-note-detail-table,
.alchemy-quickboard-results-table {
    width: max-content;
    min-width: 40rem;
    table-layout: auto;
}

.alchemy-note-detail-table thead th,
.alchemy-quickboard-results-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--table-header-bg);
    box-shadow: 0 1px 0 var(--table-border);
}

.alchemy-note-detail-table tbody tr,
.alchemy-quickboard-results-table tbody tr {
    transition: background-color 0.12s ease;
}

.alchemy-note-detail-table tbody tr:hover,
.alchemy-quickboard-results-table tbody tr:hover {
    background: var(--table-stripe);
}

.alchemy-note-detail-table th,
.alchemy-note-detail-table td,
.alchemy-quickboard-results-table th,
.alchemy-quickboard-results-table td {
    padding: 0.4rem 0.5rem;
}

.alchemy-quickboard-results-table th:nth-child(1),
.alchemy-quickboard-results-table td:nth-child(1),
.alchemy-note-detail-table th:nth-child(1),
.alchemy-note-detail-table td:nth-child(1) {
    min-width: 2.75rem;
}

.alchemy-quickboard-results-table th:nth-child(2),
.alchemy-quickboard-results-table td:nth-child(2),
.alchemy-note-detail-table th:nth-child(2),
.alchemy-note-detail-table td:nth-child(2) {
    min-width: 8.5rem;
}

.alchemy-quickboard-results-table th:nth-child(3),
.alchemy-quickboard-results-table td:nth-child(3),
.alchemy-note-detail-table th:nth-child(3),
.alchemy-note-detail-table td:nth-child(3) {
    min-width: 7rem;
}

.alchemy-quickboard-results-table th:nth-child(4),
.alchemy-quickboard-results-table td:nth-child(4),
.alchemy-note-detail-table th:nth-child(4),
.alchemy-note-detail-table td:nth-child(4) {
    min-width: 4.5rem;
}

.quickboard-level-cell,
.quickboard-rate-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.quickboard-name-cell,
.quickboard-material-cell,
.quickboard-stats-cell {
    white-space: nowrap;
}

.quickboard-name-cell {
    font-weight: 700;
}

.quickboard-stats-cell {
    min-width: 10rem;
    color: var(--text-muted);
}

.alchemy-quickboard-results-table .pred-level-badge {
    min-width: 1.7rem;
    padding-inline: 0.18rem;
    font-size: 0.68rem;
}

.alchemy-quickboard-input-row {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
}

.alchemy-quickboard-suggestions {
    position: absolute;
    top: calc(100% + 0.2rem);
    right: 0;
    left: 5.4rem;
    z-index: 8;
    display: flex;
    flex-direction: column;
    max-height: 14rem;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.alchemy-quickboard-suggestions[hidden] {
    display: none !important;
}

.alchemy-quickboard-suggestion {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 2rem;
    padding: 0.38rem 0.52rem;
    border: 0;
    border-bottom: 1px solid var(--subtle-divider);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.alchemy-quickboard-suggestion:last-child {
    border-bottom: 0;
}

.alchemy-quickboard-suggestion:hover,
.alchemy-quickboard-suggestion:focus-visible {
    background: var(--primary-soft);
    outline: none;
}

.alchemy-quickboard-suggestion span {
    color: var(--text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
}

.alchemy-quickboard-input-row label,
.alchemy-note-draft-actions label {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.alchemy-quickboard-input-row input,
.quick-slot-item,
.alchemy-note-draft-actions select {
    min-width: 0;
    min-height: 2.05rem;
    padding: 0.3rem 0.48rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-ctrl);
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
}

.alchemy-quickboard-input-row input:focus,
.quick-slot-item:focus,
.alchemy-note-draft-actions select:focus {
    border-color: var(--primary-color);
    outline: 2px solid var(--primary-glow);
}

.alchemy-quickboard-message {
    min-height: 1.05rem;
    margin-top: 0.18rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.alchemy-quickboard-message.is-error {
    color: var(--danger);
}

.alchemy-quickboard-slots {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.quick-slot-row {
    position: relative;
    display: grid;
    grid-template-columns: 1.35rem 2.45rem minmax(0, 1fr) 1.85rem 1.85rem 1.85rem;
    align-items: center;
    gap: 0.32rem;
    min-width: 0;
    padding: 0.42rem 0.5rem 0.42rem 0.72rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.quick-slot-row:hover {
    border-color: var(--border-color-hover);
}

/* Resolved material: slim teal accent bar on the left edge. */
.quick-slot-row::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.32rem;
    width: 3px;
    height: 60%;
    border-radius: 999px;
    background: var(--primary-color);
    transform: translateY(-50%);
}

/* Unresolved filter (level+material picked, item TBD): dashed inset look. */
.quick-slot-row:has(.quick-slot-filter) {
    background: var(--bg-inset);
    border-style: dashed;
}

.quick-slot-row:has(.quick-slot-filter)::before {
    background: var(--accent-gold);
}

.quick-slot-book {
    border-style: dashed;
}

.quick-slot-book::before {
    background: var(--accent-gold);
}

.quick-slot-index {
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.7rem;
    font-weight: 800;
}

.quick-slot-kind {
    color: var(--text-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.quick-slot-controls,
.quick-slot-filter,
.quick-slot-exact {
    min-width: 0;
}

.quick-slot-filter {
    display: grid;
    grid-template-columns: auto minmax(8rem, 1fr);
    align-items: center;
    gap: 0.4rem;
}

.quick-slot-filter > span {
    color: var(--primary-strong);
    font-size: 0.74rem;
    font-weight: 700;
}

.quick-slot-exact {
    display: flex;
    align-items: baseline;
    gap: 0.42rem;
    overflow: hidden;
}

.quick-slot-exact strong,
.quick-slot-exact span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-slot-exact strong {
    font-size: 0.78rem;
}

.quick-slot-exact span {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.quick-slot-move:hover:not(:disabled),
.quick-slot-move:focus-visible:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-strong);
    outline: none;
}

.quick-slot-move:disabled {
    cursor: not-allowed;
    opacity: 0.28;
}

.quick-slot-spacer {
    grid-column: span 2;
}

.alchemy-note-draft-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.alchemy-note-draft-actions select {
    width: 6.2rem;
}

.primary-button {
    min-height: 2.1rem;
    margin-left: auto;
    padding: 0.32rem 0.85rem;
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--button-hover-text);
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--primary-glow);
    outline: none;
}

.primary-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.alchemy-quickboard-meta {
    margin: 0.5rem 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.alchemy-quickboard-range {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
}

.alchemy-quickboard-range strong {
    color: var(--text-main);
    font-size: 0.76rem;
}

.alchemy-quickboard-range span {
    text-align: right;
}

.alchemy-quickboard-formula {
    margin-top: 0.22rem;
    overflow-wrap: anywhere;
}

.alchemy-quickboard-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0 0 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--subtle-divider);
    border-radius: 8px;
    background: var(--bg-inset);
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.5;
}

.alchemy-quickboard-disclaimer-icon {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    color: var(--accent-gold);
}

.alchemy-quickboard-disclaimer strong {
    flex: 0 0 auto;
    color: var(--text-main);
    font-weight: 700;
}

.alchemy-quickboard-empty {
    padding: 0.9rem !important;
    color: var(--text-muted);
    text-align: center !important;
    font-size: 0.76rem;
}

.alchemy-note-result-action,
.alchemy-note-action-heading {
    width: 3.2rem;
    text-align: center !important;
    white-space: nowrap;
}

.alchemy-note-add-item {
    width: 2rem;
    height: 1.75rem;
    padding: 0;
    border-color: var(--border-color);
    background: var(--bg-card);
    color: var(--primary-strong);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.alchemy-note-save-step {
    min-height: 1.75rem;
    padding: 0.16rem 0.48rem;
    border-color: var(--border-color);
    background: var(--bg-card);
    color: var(--primary-strong);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.alchemy-note-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

.alchemy-note-card-actions .text-button {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-ctrl);
    padding: 0.22rem 0.45rem;
    color: var(--primary-strong);
}

.alchemy-note-add-item:hover:not(:disabled),
.alchemy-note-add-item:focus-visible:not(:disabled),
.alchemy-note-save-step:hover,
.alchemy-note-save-step:focus-visible {
    border-color: var(--primary-color);
    background: var(--primary-soft);
    outline: none;
}

.alchemy-note-add-item:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.alchemy-note-save-step {
    margin-left: 0.4rem;
    vertical-align: middle;
}

.alchemy-note-toast {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 60;
    max-width: min(23rem, calc(100vw - 2rem));
    padding: 0.5rem 0.72rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background: var(--overlay-bg);
    box-shadow: var(--overlay-shadow);
    color: var(--text-main);
    font-size: 0.74rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.25rem);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.alchemy-note-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 720px) {
    .alchemy-note-shell {
        right: 1rem;
        bottom: 1rem;
        z-index: 1000;
    }

    .alchemy-note-launcher {
        min-height: 2.6rem;
        padding: 0.45rem 1rem;
        font-size: 0.82rem;
    }

    .alchemy-note-popover {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        max-height: 84dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 38px rgba(0, 0, 0, 0.32);
        padding-bottom: env(safe-area-inset-bottom, 0.5rem);
    }

    .alchemy-note-popover::before {
        border-radius: 16px 16px 0 0;
    }

    .alchemy-quickboard-tabs {
        margin-inline: 0.7rem;
    }

    .alchemy-quickboard-tab {
        min-height: 2.35rem;
    }

    .quick-slot-row {
        grid-template-columns: 1.35rem 2.45rem minmax(0, 1fr) 1.8rem 1.8rem 1.8rem;
    }

    .quick-slot-controls {
        grid-column: 3 / -1;
        grid-row: 2;
    }

    .quick-slot-filter {
        grid-template-columns: 1fr;
    }

    .alchemy-note-draft-actions {
        flex-wrap: wrap;
    }

    .alchemy-note-draft-actions .primary-button {
        flex: 1 1 10rem;
    }

    .alchemy-note-result-action,
    .alchemy-note-action-heading {
        width: 3rem !important;
    }

    .alchemy-note-add-item {
        width: 1.9rem;
    }

    .alchemy-note-toast {
        position: fixed;
        top: auto;
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alchemy-note-popover,
    .alchemy-note-card,
    .alchemy-note-launcher,
    .alchemy-quickboard-tab,
    .primary-button,
    .alchemy-note-toast,
    .quick-slot-row,
    .alchemy-note-close,
    .alchemy-note-delete,
    .quick-slot-move,
    .quick-slot-remove,
    .alchemy-note-close svg,
    .alchemy-note-delete svg,
    .quick-slot-remove svg,
    .alchemy-note-detail-table tbody tr,
    .alchemy-quickboard-results-table tbody tr {
        animation: none;
        transition: none;
        transform: none;
    }

    .alchemy-note-card:hover,
    .alchemy-note-card:focus-visible,
    .primary-button:hover:not(:disabled),
    .primary-button:focus-visible:not(:disabled) {
        transform: none;
    }

    .alchemy-note-close:hover svg,
    .alchemy-note-delete:hover svg,
    .quick-slot-remove:hover svg {
        transform: none;
    }
}
