/**
 * watchlist_widget.css
 * BEM namespace: .watchlist-widget
 *
 * Right-rail watchlist card with live-tick price flashes.
 */

.watchlist-widget {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 18px;
}

.watchlist-widget__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0;
    margin-bottom: 12px;
}
.watchlist-widget__title-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.watchlist-widget__title-copy i {
    color: var(--iris);
}
.watchlist-widget__title-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.watchlist-widget__title-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface-2);
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 12px;
    color: var(--iris);
    cursor: pointer;
}
.watchlist-widget__title-action:hover {
    border-color: color-mix(in srgb, var(--iris) 24%, var(--hairline));
    background: var(--iris-tint);
}
.watchlist-widget__title-action--expand {
    color: var(--text-2);
}

.watchlist-widget__settings {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -4px 0 10px;
}
.watchlist-widget__settings[hidden] {
    display: none;
}
.watchlist-widget__range-btn {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font: 750 11px 'Inter Tight', 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__range-btn--active {
    color: var(--iris);
    border-color: color-mix(in srgb, var(--iris) 30%, var(--hairline));
    background: var(--iris-tint);
}

.watchlist-widget__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.watchlist-widget__row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 56px 86px auto 0;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.3s;
}
.watchlist-widget__row:hover { background: var(--surface-2); }

.watchlist-widget__row--up {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 12%, transparent);
}

.watchlist-widget__row--down {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 12%, transparent);
}

/* Edit-mode reveals the per-row remove (X) column. The button is in
   markup at all times so the surrounding row DOM (notably the logo
   <img>) is never reconstructed when toggling Edit/Done. */
.watchlist-widget--editing .watchlist-widget__row {
    grid-template-columns: 28px minmax(0, 1fr) 56px 86px auto 24px;
}

.watchlist-widget__logo {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
}
.watchlist-widget__logo-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
}
.watchlist-widget__logo-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--iris-tint), color-mix(in srgb, var(--cyan) 14%, transparent));
    color: var(--iris);
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0;
    border: 1px solid color-mix(in srgb, var(--iris) 18%, transparent);
}

.watchlist-widget__remove {
    width: 22px;
    height: 22px;
    display: none; /* shown by .watchlist-widget--editing rule above */
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.watchlist-widget--editing .watchlist-widget__remove { display: grid; }
.watchlist-widget__remove:hover {
    transform: scale(1.12);
    background: var(--red-tint);
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 30%, transparent);
}

.watchlist-widget__ident { min-width: 0; }

.watchlist-widget__row--flash-up {
    background: var(--green-tint);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent);
}
.watchlist-widget__row--flash-down {
    background: var(--red-tint);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent);
}

.watchlist-widget__symbol {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 1px 7px;
    border-radius: 999px;
    font-family: 'Inter Tight', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0;
}

.watchlist-widget__symbol--up {
    color: var(--green-2);
    background: var(--green-tint);
}

.watchlist-widget__symbol--down {
    color: var(--red);
    background: var(--red-tint);
}

.watchlist-widget__name {
    font-size: 11px;
    color: var(--text-3);
}

.watchlist-widget__spark {
    width: 56px;
    height: 24px;
}

.watchlist-widget__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.watchlist-widget__price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-feature-settings: "tnum";
}

.watchlist-widget__change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-feature-settings: "tnum";
}
.watchlist-widget__change--up { color: var(--green-2); }
.watchlist-widget__change--down { color: var(--red); }

.watchlist-widget__market-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: var(--surface-2);
    color: var(--text-3);
    font: 800 10px 'Inter Tight', 'Inter', sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
}

.watchlist-widget__market-status svg {
    width: 12px;
    height: 12px;
}

.watchlist-widget__market-status--compact {
    min-height: 18px;
    gap: 3px;
    padding: 0 5px;
    font-size: 8px;
}

.watchlist-widget__market-status--compact svg {
    width: 9px;
    height: 9px;
}

.watchlist-widget__market-status--open {
    background: var(--green-tint);
    color: var(--green-2);
    border-color: color-mix(in srgb, var(--green) 28%, var(--hairline));
}

.watchlist-widget__market-status--closed {
    background: var(--red-tint);
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 28%, var(--hairline));
}

.watchlist-widget__market-status--premarket,
.watchlist-widget__market-status--afterhours {
    background: color-mix(in srgb, var(--amber) 14%, transparent);
    color: var(--amber);
    border-color: color-mix(in srgb, var(--amber) 28%, var(--hairline));
}

.watchlist-widget__list--empty {
    padding: 4px 2px;
}

.watchlist-widget__placeholder {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
    padding: 6px 4px;
}

.watchlist-widget__empty-link {
    color: var(--iris);
    text-decoration: none;
    font-weight: 600;
}
.watchlist-widget__empty-link:hover { text-decoration: underline; }

/* Inline "Add ticker" form, only visible while the widget is in edit mode. */
.watchlist-widget__add {
    position: relative;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
}
.watchlist-widget__add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}
.watchlist-widget__add-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    font-family: 'Inter Tight', sans-serif;
    font-size: 13px;
    letter-spacing: 0;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
}
.watchlist-widget__add-input:focus {
    border-color: var(--iris);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--iris) 18%, transparent);
}
.watchlist-widget__add-input::placeholder {
    color: var(--text-3);
    text-transform: none;
    letter-spacing: 0;
}
/* Add button uses the canonical .btn .btn--primary classes from
   shared/browser/buttons.css per design guideline §5. The local
   selector is kept ONLY to constrain height so the button matches
   the input row; no colour overrides. */
.btn.btn--primary.watchlist-widget__add-button {
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    min-height: 0;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.watchlist-widget__add-error {
    margin-top: 6px;
    font-size: 11px;
    color: var(--red);
    line-height: 1.4;
}

/* Typeahead suggestions dropdown - opens below the input as soon as
   the user starts typing and is closed on blur, Escape or selection. */
.watchlist-widget__suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    box-shadow: var(--shadow-pop, var(--shadow-soft));
    max-height: 280px;
    overflow-y: auto;
}
.watchlist-widget__suggestion {
    display: grid;
    grid-template-columns: 28px auto auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
}
.watchlist-widget__suggestion-logo,
.watchlist-widget__suggestion-logo-img,
.watchlist-widget__suggestion-logo-fallback {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.watchlist-widget__suggestion-logo {
    display: grid;
    place-items: center;
}
.watchlist-widget__suggestion-logo-img {
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
}
.watchlist-widget__suggestion-logo-fallback {
    display: grid;
    place-items: center;
    background: var(--iris-tint);
    color: var(--iris);
    border: 1px solid color-mix(in srgb, var(--iris) 18%, transparent);
    font: 700 10px 'Inter Tight', sans-serif;
}
.watchlist-widget__suggestion--owned {
    cursor: default;
    opacity: 0.65;
}
.watchlist-widget__owned-badge {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    font-size: 9px;
    letter-spacing: 0.06em;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-3);
    border: 1px solid var(--hairline);
    text-transform: uppercase;
    white-space: nowrap;
}
.watchlist-widget__suggestion:hover,
.watchlist-widget__suggestion--active {
    background: var(--surface-2);
}
.watchlist-widget__suggestion-symbol {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0;
    color: var(--text);
}
.watchlist-widget__suggestion-name {
    font-size: 11px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Asset-kind pill - colour-coded so users can tell stock vs crypto
   vs ETF at a glance. Symbol prefix stays $ across all kinds (matches
   Stocktwits convention); the badge does the disambiguation. */
.watchlist-widget__symbol-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.watchlist-widget__kind-badge {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    font-size: 9px;
    letter-spacing: 0.06em;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-3);
    border: 1px solid var(--hairline);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.watchlist-widget__kind-badge--stock {
    background: var(--iris-tint);
    color: var(--iris);
    border-color: color-mix(in srgb, var(--iris) 22%, transparent);
}
.watchlist-widget__kind-badge--crypto {
    background: color-mix(in srgb, var(--amber, #f59e0b) 14%, transparent);
    color: var(--amber, #b45309);
    border-color: color-mix(in srgb, var(--amber, #f59e0b) 30%, transparent);
}
.watchlist-widget__kind-badge--etf {
    background: var(--green-tint);
    color: var(--green-2);
    border-color: color-mix(in srgb, var(--green) 26%, transparent);
}
.watchlist-widget__kind-badge--fx,
.watchlist-widget__kind-badge--future {
    background: color-mix(in srgb, var(--cyan) 14%, transparent);
    color: var(--cyan);
    border-color: color-mix(in srgb, var(--cyan) 26%, transparent);
}

.watchlist-widget__expand-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: stretch;
    padding: 3vh 3vw;
    background: var(--modal-backdrop);
}
.watchlist-widget__expand-modal[hidden] {
    display: none;
}
.watchlist-widget__expand-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}
.watchlist-widget__expand-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hairline);
}
.watchlist-widget__expand-title {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.watchlist-widget__expand-title-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.watchlist-widget__expand-head strong {
    display: block;
    color: var(--text);
    font: 800 18px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-title-separator {
    width: 1px;
    height: 42px;
    align-self: center;
    background: color-mix(in srgb, var(--text) 16%, var(--hairline));
}
.watchlist-widget__expand-subtitle {
    display: block;
    color: var(--text-3);
    font: 650 12px 'Inter', sans-serif;
}
.watchlist-widget__expand-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.watchlist-widget__expand-edit-toggle {
    min-width: 74px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 18px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--iris);
    font: 850 13px 'Inter Tight', 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__expand-modal--editing .watchlist-widget__expand-edit-toggle {
    border-color: color-mix(in srgb, var(--green) 30%, var(--hairline));
    background: var(--green-tint);
    color: var(--green-2);
}
.watchlist-widget__expand-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-2);
    font: 800 20px/1 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__expand-body {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    overflow: hidden;
}
.watchlist-widget__expand-default {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    border-right: 1px solid var(--hairline);
    background: var(--surface);
}
.watchlist-widget__expand-section-title {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
    color: var(--text-2);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.watchlist-widget__expand-default-add {
    position: relative;
    padding: 10px 8px;
    border-bottom: 1px solid var(--hairline);
}
.watchlist-widget__expand-default-add[hidden] {
    display: none;
}
.watchlist-widget__expand-default-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}
.watchlist-widget__expand-default-add-input {
    width: 100%;
    height: 32px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
    text-transform: uppercase;
}
.watchlist-widget__expand-default-add-input::placeholder {
    color: var(--text-3);
    text-transform: none;
}
.watchlist-widget__expand-default-add-button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--iris);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__expand-default-error {
    margin-top: 6px;
    color: var(--red);
    font: 700 11px 'Inter', sans-serif;
}
.watchlist-widget__expand-default-list {
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}
.watchlist-widget__expand-default-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 56px auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
}
.watchlist-widget__expand-default-row:hover {
    background: var(--surface-2);
}
.watchlist-widget__expand-default-row--up {
    border: 1px solid color-mix(in srgb, var(--green) 18%, transparent);
}
.watchlist-widget__expand-default-row--down {
    border: 1px solid color-mix(in srgb, var(--red) 18%, transparent);
}
.watchlist-widget__expand-default-ident,
.watchlist-widget__expand-default-quote {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.watchlist-widget__expand-default-ident strong,
.watchlist-widget__expand-default-quote strong {
    color: var(--text);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-default-ident small,
.watchlist-widget__expand-default-quote small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-3);
    font: 650 11px 'Inter', sans-serif;
}
.watchlist-widget__expand-default-quote {
    justify-items: end;
}
.watchlist-widget__expand-builder {
    min-width: 0;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.watchlist-widget__expand-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
}
.watchlist-widget__expand-toolbar[hidden] {
    display: none;
}
.watchlist-widget__expand-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-toggle {
    margin-left: auto;
}
.watchlist-widget__expand-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.watchlist-widget__expand-toggle span {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: var(--surface-2);
    transition: background 0.14s ease, border-color 0.14s ease;
}
.watchlist-widget__expand-toggle span::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-3);
    transition: transform 0.14s ease, background 0.14s ease;
}
.watchlist-widget__expand-toggle input:checked + span {
    background: var(--green-tint);
    border-color: color-mix(in srgb, var(--green) 30%, var(--hairline));
}
.watchlist-widget__expand-toggle input:checked + span::before {
    transform: translateX(18px);
    background: var(--green-2);
}
.watchlist-widget__expand-toggle strong {
    color: var(--text-2);
    font: 850 12px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-toolbar input {
    width: 64px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font: 800 12px 'Inter', sans-serif;
}
.watchlist-widget__expand-toolbar input:disabled,
.watchlist-widget__expand-default-add-input:disabled,
.watchlist-widget__expand-default-add-button:disabled,
.watchlist-widget__expand-group-name:disabled,
.watchlist-widget__expand-add-ticker input:disabled,
.watchlist-widget__expand-add-ticker button:disabled,
.watchlist-widget__expand-remove-group:disabled,
.watchlist-widget__expand-chip button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}
.watchlist-widget__expand-layout-error {
    margin: 10px 14px 0;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
    border-radius: 10px;
    background: var(--red-tint);
    color: var(--red);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-layout-error[hidden] {
    display: none;
}
.watchlist-widget__expand-groups {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(var(--watchlist-expand-columns), minmax(180px, 1fr));
    grid-template-rows: repeat(var(--watchlist-expand-rows), minmax(150px, 1fr));
    gap: 10px;
    align-content: stretch;
    overflow: auto;
    padding: 12px;
    background: transparent;
}
.watchlist-widget__expand-modal--editing .watchlist-widget__expand-groups {
    gap: 2px;
    border: 1px solid color-mix(in srgb, var(--text) 16%, var(--hairline));
    background: color-mix(in srgb, var(--text) 14%, var(--hairline));
}
.watchlist-widget__expand-group {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--surface-2);
}
.watchlist-widget__expand-modal--editing .watchlist-widget__expand-group {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    border: 0;
    border-radius: 0;
}
.watchlist-widget__expand-group::before,
.watchlist-widget__expand-group::after {
    content: "";
    position: absolute;
    pointer-events: none;
    display: none;
}
.watchlist-widget__expand-group--dragging {
    opacity: 0.58;
    outline: 2px solid color-mix(in srgb, var(--iris) 44%, transparent);
    outline-offset: -2px;
}
.watchlist-widget__expand-group--drop-target {
    background: color-mix(in srgb, var(--iris) 10%, var(--surface-2));
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--iris) 48%, transparent);
}
.watchlist-widget__expand-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}
.watchlist-widget__expand-modal--editing .watchlist-widget__expand-group-head {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
}
.watchlist-widget__expand-drag {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-3);
    cursor: grab;
}
.watchlist-widget__expand-drag:active {
    cursor: grabbing;
}
.watchlist-widget__expand-drag svg {
    width: 18px;
    height: 18px;
}
.watchlist-widget__expand-drag:focus-visible {
    outline: 2px solid var(--iris);
    outline-offset: 2px;
}
.watchlist-widget__expand-group--locked .watchlist-widget__expand-drag {
    display: none;
}
.watchlist-widget__expand-group-name,
.watchlist-widget__expand-add-ticker input {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-group--locked .watchlist-widget__expand-group-name {
    border-color: transparent;
    background: transparent;
    padding-left: 0;
    color: var(--text);
    opacity: 1;
}
.watchlist-widget__expand-remove-group {
    width: 30px;
    height: 30px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-2);
    font: 800 18px/1 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__expand-group--locked .watchlist-widget__expand-remove-group,
.watchlist-widget__expand-group--locked .watchlist-widget__expand-add-ticker,
.watchlist-widget__expand-group--locked .watchlist-widget__expand-chip button {
    display: none;
}
.watchlist-widget__expand-chips {
    min-height: 0;
    display: grid;
    gap: 6px;
    align-content: start;
    align-items: start;
    overflow-y: auto;
}
.watchlist-widget__expand-group-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 22px 28px minmax(0, 1fr) 56px auto 48px 24px;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface);
}
.watchlist-widget__expand-group-row--up {
    border-color: color-mix(in srgb, var(--green) 20%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 12%, transparent);
}
.watchlist-widget__expand-group-row--down {
    border-color: color-mix(in srgb, var(--red) 20%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 12%, transparent);
}

.watchlist-widget__expand-group-row--ticker-dragging {
    opacity: 0.58;
    outline: 2px solid color-mix(in srgb, var(--iris) 44%, transparent);
}

.watchlist-widget__expand-group-row--ticker-drop-before {
    box-shadow:
        inset 0 3px 0 var(--iris),
        inset 0 0 0 1px color-mix(in srgb, var(--iris) 18%, transparent);
}

.watchlist-widget__expand-group-row--ticker-drop-after {
    box-shadow:
        inset 0 -3px 0 var(--iris),
        inset 0 0 0 1px color-mix(in srgb, var(--iris) 18%, transparent);
}

.watchlist-widget__expand-ticker-drag {
    width: 20px;
    height: 28px;
    display: grid;
    grid-template-columns: repeat(2, 4px);
    grid-auto-rows: 4px;
    place-content: center;
    gap: 3px;
    border-radius: 8px;
    color: color-mix(in srgb, var(--text-2) 72%, transparent);
    cursor: grab;
    transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.watchlist-widget__expand-ticker-drag span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.watchlist-widget__expand-ticker-drag:hover,
.watchlist-widget__expand-ticker-drag:focus-visible {
    color: var(--iris);
    background: var(--iris-tint);
    transform: scale(1.08);
}

.watchlist-widget__expand-ticker-drag:active {
    cursor: grabbing;
}

.watchlist-widget__expand-symbol-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    font: 850 11px 'Inter Tight', 'Inter', sans-serif;
    letter-spacing: 0;
}

.watchlist-widget__expand-symbol-pill--up {
    background: var(--green-tint);
    color: var(--green-2);
}

.watchlist-widget__expand-symbol-pill--down {
    background: var(--red-tint);
    color: var(--red);
}

.watchlist-widget__expand-group--locked .watchlist-widget__expand-group-row {
    grid-template-columns: 28px minmax(0, 1fr) 56px auto;
}

.watchlist-widget__expand-modal--no-mini-chart .watchlist-widget__expand-default-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
}

.watchlist-widget__expand-modal--no-mini-chart .watchlist-widget__expand-group-row {
    grid-template-columns: 22px 28px minmax(0, 1fr) auto 48px 24px;
}

.watchlist-widget__expand-modal--no-mini-chart .watchlist-widget__expand-group--locked .watchlist-widget__expand-group-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
}

.watchlist-widget__expand-group-ident,
.watchlist-widget__expand-group-quote {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.watchlist-widget__expand-symbol-line {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.watchlist-widget__expand-group-ident strong,
.watchlist-widget__expand-group-quote strong {
    color: var(--text);
    font: 850 12px 'Inter Tight', 'Inter', sans-serif;
}

.watchlist-widget__expand-group-ident small,
.watchlist-widget__expand-group-quote small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-3);
    font: 650 11px 'Inter', sans-serif;
}

.watchlist-widget__expand-group-quote {
    justify-items: end;
}

.watchlist-widget__expand-order-controls {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    align-items: center;
}

.watchlist-widget__expand-group-row button {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    font: 800 14px/1 'Inter', sans-serif;
    cursor: pointer;
    transition: transform 0.14s ease, background 0.14s ease;
}

.watchlist-widget__expand-order-controls button {
    width: 22px;
    height: 22px;
    font-size: 10px;
}

.watchlist-widget__expand-group-row button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    transform: none;
}

.watchlist-widget__expand-group-row button:hover,
.watchlist-widget__expand-remove-group:hover,
.watchlist-widget__expand-close:hover,
.watchlist-widget__expand-edit-toggle:hover,
.watchlist-widget__expand-default-add-button:hover,
.watchlist-widget__expand-add-ticker button:hover,
.watchlist-widget__title-action:hover,
.watchlist-widget__range-btn:hover {
    transform: scale(1.04);
}

.watchlist-widget__expand-group-row button:disabled:hover {
    transform: none;
}

.watchlist-widget__expand-group--locked .watchlist-widget__expand-group-row button,
.watchlist-widget__expand-group--locked .watchlist-widget__expand-order-controls,
.watchlist-widget__expand-group--locked .watchlist-widget__expand-ticker-drag {
    display: none;
}
.watchlist-widget__expand-chip {
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 8px;
    border: 1px solid color-mix(in srgb, var(--iris) 24%, var(--hairline));
    border-radius: 999px;
    background: var(--iris-tint);
    color: var(--iris);
    font: 800 11px 'Inter Tight', 'Inter', sans-serif;
}
.watchlist-widget__expand-chip button {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: currentColor;
    font: 800 14px/1 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__expand-add-ticker {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}
.watchlist-widget__expand-add-ticker button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface);
    color: var(--iris);
    font: 800 12px 'Inter Tight', 'Inter', sans-serif;
    cursor: pointer;
}
.watchlist-widget__expand-empty,
.watchlist-widget__expand-error {
    color: var(--text-3);
    font: 650 12px 'Inter', sans-serif;
}
.watchlist-widget__expand-error {
    color: var(--red);
}
.watchlist-widget__expand-suggestions {
    top: calc(100% + 4px);
    z-index: 30;
}

@media (max-width: 840px) {
    .watchlist-widget__expand-modal {
        padding: 3vh 3vw;
    }
    .watchlist-widget__expand-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(180px, 34vh) minmax(0, 1fr);
    }
    .watchlist-widget__expand-default {
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
    }

    .watchlist-widget__expand-default-row {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        grid-template-areas:
            "logo ident quote"
            "logo spark quote";
        gap: 6px 10px;
        align-items: center;
    }

    .watchlist-widget__expand-default-row > .watchlist-widget__logo {
        grid-area: logo;
    }

    .watchlist-widget__expand-default-ident {
        grid-area: ident;
    }

    .watchlist-widget__expand-default-row > .watchlist-widget__spark {
        grid-area: spark;
        width: min(96px, 100%);
        justify-self: start;
    }

    .watchlist-widget__expand-default-quote {
        grid-area: quote;
    }
}

@media (max-width: 560px) {
    .watchlist-widget__row,
    .watchlist-widget--editing .watchlist-widget__row {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        grid-template-areas:
            "logo ident status"
            "logo spark quote"
            ". remove remove";
        gap: 6px 10px;
        padding: 10px;
    }

    .watchlist-widget__row > .watchlist-widget__logo {
        grid-area: logo;
    }

    .watchlist-widget__ident {
        grid-area: ident;
    }

    .watchlist-widget__row > .watchlist-widget__spark {
        grid-area: spark;
        width: min(96px, 100%);
        justify-self: start;
    }

    .watchlist-widget__right {
        grid-area: quote;
    }

    .watchlist-widget__row > .watchlist-widget__market-status {
        grid-area: status;
        justify-self: end;
    }

    .watchlist-widget__remove {
        grid-area: remove;
        justify-self: end;
    }
}
