/* Invest manually: amount entry, holdings upload and the order / rebalance table.
   Shared by the desktop and mobile portfolio pages. */
.invest-manually{ padding: var(--space-16) var(--space-page-gutter-xl); }
@media (min-width:768px) and (max-width:1200px) { .invest-manually { padding: var(--space-16) var(--space-layout-sm); } }
/* --- Invest manually: amount entry + generated order list --------------- */
.im-head{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-10);
    border-radius: 16px;
    background: var(--Pink-light, #FFEBFC);
    padding: var(--space-component-lg) var(--space-10);
}
.im-head-text{ flex: 1 1 0; min-width: 0; max-width: 560px; }
.im-head-text h3{
    color: var(--Grey-900, #101828);
    font-size: var(--text-title-lg);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-component-xs);
}
.im-head-text p{
    color: var(--text-muted, #475467);
    font-size: var(--text-body);
    line-height: 1.5;
    margin-bottom: 0;
}
.im-form{ flex: 0 0 620px; width: 620px; max-width: 100%; }
.im-label{
    display: block;
    margin-bottom: 6px;
    font-size: var(--text-body-sm);
    font-weight: 600;
    color: var(--Grey-700, #344054);
}
.im-input-row{ display: flex; gap: 10px; align-items: stretch; }
.im-amount{
    min-width: 180px;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    height: 52px;
    border: 1px solid var(--control-border, #D0D5DD);
    border-radius: 10px;
    background: var(--White, #FFF);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.im-amount:focus-within{
    border-color: var(--text-link-teal, #25594D);
    box-shadow: 0 0 0 3px var(--purple_medium, #D9D0FC);
}
.im-prefix{
    padding: 0 0 0 14px;
    font-size: var(--text-body-lg);
    font-weight: 600;
    color: var(--Grey-600, #475467);
}
.im-amount input.form-control{
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 14px 0 8px;
    font-size: var(--text-body-lg);
    font-weight: 600;
    color: var(--Grey-900, #101828);
    -moz-appearance: textfield;
}
.im-amount input::-webkit-outer-spin-button,
.im-amount input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.im-amount input:focus{ outline: none; box-shadow: none; }
.im-amount input::placeholder{ color: var(--Grey-400, #98A2B3); font-weight: 400; }
.im-generate{
    flex: 0 0 auto;
    height: 52px;
    padding: 0 var(--space-component-lg);
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.im-help, .im-warning{
    display: block;
    margin-top: 8px;
    font-size: var(--text-caption);
    line-height: 1.4;
}
.im-help{ color: var(--Grey-600, #475467); }
.im-template{ margin-top: 10px; line-height: 1.6; }
.im-template code{ font-size: 12px; color: var(--Grey-700, #344054); background: var(--White, #FFF); border: 1px solid var(--Grey-200, #EAECF0); border-radius: 6px; padding: 1px 6px; }
.im-code{ font-size: 12px; margin-left: 6px; }
.im-template-link{ display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-link-teal, #25594D); text-decoration: none; }
.im-template-link:hover{ text-decoration: underline; color: var(--text-link-teal, #25594D); }
.im-warning{ color: var(--text-error, #B42318); }

.im-result{
    display: flex;
    flex-direction: column;
    gap: var(--space-component-lg);
    margin-top: var(--space-component-lg);
}
.im-stats{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-component-md);
}
.im-stat{
    border-radius: 12px;
    border: 1px solid var(--Grey-200, #EAECF0);
    background: var(--Grey-50, #F9FAFB);
    padding: var(--space-component-md) var(--space-component-lg);
}
.im-stat p{ margin-bottom: 0; }
.im-stat-label{
    color: var(--Grey-600, #475467);
    font-size: var(--text-body-sm);
    font-weight: 500;
    line-height: 1.4;
}
.im-stat-value{
    margin-top: 4px;
    color: var(--Grey-900, #101828);
    font-size: var(--text-title-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.im-stat-note{
    margin-top: 6px;
    color: var(--Grey-500, #667085);
    font-size: var(--text-caption);
    line-height: 1.4;
}

.im-table-card{
    border-radius: 16px;
    border: 1px solid var(--Grey-200, #EAECF0);
    background: var(--White, #FFF);
    overflow: hidden;
}
.im-table-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-component-md);
    padding: var(--space-component-md) var(--space-component-lg);
    border-bottom: 1px solid var(--Grey-200, #EAECF0);
}
.im-table-title{
    color: var(--Grey-900, #101828);
    font-size: var(--text-title-sm);
    font-weight: 700;
    margin-bottom: 2px;
}
.im-table-meta{
    color: var(--Grey-600, #475467);
    font-size: var(--text-body-sm);
    margin-bottom: 0;
}
.im-download{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 var(--space-component-md);
    border-radius: 10px;
    border: 1px solid var(--Grey-300, #D0D5DD);
    background: var(--White, #FFF);
    color: var(--Grey-700, #344054);
    font-size: var(--text-body-sm);
    font-weight: 600;
    white-space: nowrap;
}
.im-download:hover{ background: var(--Grey-50, #F9FAFB); color: var(--Grey-900, #101828); }

.im-upload{ margin: 0; cursor: pointer; border: 1px solid var(--Grey-900, #101828); background: var(--White, #FFF); color: var(--Grey-900, #101828); display: inline-flex; align-items: center; }
.im-upload:hover{ background: var(--Grey-50, #F9FAFB); }
.im-buy{ color: var(--text-link-teal, #25594D); font-weight: 700; }
.im-sell{ color: var(--text-error, #B42318); font-weight: 700; }
.im-pos{ color: var(--text-link-teal, #25594D); }
.im-neg{ color: var(--text-error, #B42318); }
.allocation-table-box{ margin: 0; border: 0; border-radius: 0; overflow-x: auto; }
.allocation-table-box table{ width: 100%; border-collapse: collapse; }
.allocation-table-box thead th{
    background: var(--Grey-50, #F9FAFB);
    padding: var(--space-component-sm) var(--space-component-lg);
    color: var(--Grey-600, #475467);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--Grey-200, #EAECF0);
    white-space: nowrap;
}
.allocation-table-box tbody td{
    padding: 14px var(--space-component-lg);
    color: var(--Grey-900, #101828);
    font-size: var(--text-body);
    line-height: 1.4;
    border-bottom: 1px solid var(--Grey-100, #F2F4F7);
}
.allocation-table-box tbody tr:last-child td{ border-bottom: 0; }
.allocation-table-box tbody tr:hover td{ background: var(--Grey-50, #F9FAFB); }
.allocation-table-box td.im-num, .allocation-table-box th.im-num{ text-align: right; font-variant-numeric: tabular-nums; }
.allocation-table-box td.im-qty{ font-weight: 700; }
.allocation-table-box td.im-muted{ color: var(--Grey-600, #475467); }
.allocation-table-box table.dataTable thead th.sorting,
.allocation-table-box table.dataTable thead th.sorting_asc,
.allocation-table-box table.dataTable thead th.sorting_desc{ padding-right: 26px; }
.allocation-table-box .dataTables_wrapper{ padding-bottom: 0; }
.allocation-table-box .dataTables_info,
.allocation-table-box .dataTables_paginate{
    padding: 12px var(--space-component-lg);
    font-size: var(--text-caption);
    color: var(--Grey-600, #475467);
    border-top: 1px solid var(--Grey-200, #EAECF0);
}
.allocation-table-box .dataTables_info{ float: left; }
.allocation-table-box .dataTables_paginate{ float: right; }
.allocation-table-box .dataTables_paginate .paginate_button{
    padding: 4px 10px;
    margin: 0 2px;
    border-radius: 8px;
    border: 1px solid transparent !important;
    background: none !important;
    color: var(--Grey-700, #344054) !important;
    font-weight: 600;
    box-shadow: none !important;
}
.allocation-table-box .dataTables_paginate .paginate_button:hover{ background: var(--Grey-100, #F2F4F7) !important; }
.allocation-table-box .dataTables_paginate .paginate_button.current{
    background: var(--Grey-900, #101828) !important;
    color: #fff !important;
}
.allocation-table-box .dataTables_paginate .paginate_button.disabled{ opacity: .4; }
.allocation-table-box .dataTables_empty{ padding: var(--space-component-lg); color: var(--Grey-600, #475467); }

@media (max-width: 991.98px) {
    .im-form { flex: 0 0 auto; width: 100%; }
    .im-head { flex-direction: column; }
    .im-form { width: 100%; }
    .im-input-row { flex-wrap: wrap; }
    .im-amount { flex: 1 1 100%; }
    .im-generate { flex: 1 1 0; }
    .im-amount, .im-generate { height: 46px; }
    .im-generate { font-size: var(--text-body-sm); }
    .im-stats { grid-template-columns: minmax(0, 1fr); }
    .im-table-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767.98px) {
    .im-hide-sm { display: none; }   /* secondary table columns on phones */
    .allocation-table-box table { table-layout: auto; }
    .allocation-table-box th:first-child, .allocation-table-box td:first-child { white-space: normal; width: auto !important; }
    .invest-manually { padding: var(--space-component-lg) var(--space-component-md); }
    .im-head { padding: var(--space-component-lg) var(--space-component-md); border-radius: 12px; }
    .im-head-text h3 { font-size: var(--text-title-sm); }
    .im-head-text p { font-size: var(--text-body-sm); }
    .im-generate { flex: 1 1 100%; }
    .im-stat-value { font-size: var(--text-title-sm); }
    .im-table-head { padding: var(--space-component-md); }
    .im-table-card { border-radius: 12px; }
    .allocation-table-box thead th, .allocation-table-box tbody td { padding-left: 10px; padding-right: 10px; white-space: nowrap; }
}

/* --- Subscribe mode chooser (unsubscribed equity): on Wright, or via a broker ---- */
.sub-mode{ width: 100%; margin-top: 8px; }
/* the button sits in a 238px column; "Subscribe via smallcase" needs the side padding trimmed to stay on one line */
#main_button.has-mode{ padding-left: 12px !important; padding-right: 12px !important; white-space: nowrap; }
.sub-mode-seg{ display: flex; padding: 3px; border-radius: 10px; background: var(--Grey-200, #EAECF0); }
.sub-mode-opt{
    flex: 1 1 0; height: 32px; border: 0; border-radius: 8px; background: transparent;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--Grey-600, #475467); cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.sub-mode-opt:hover{ color: var(--Grey-900, #101828); }
.sub-mode-opt.is-selected{ background: var(--White, #FFF); color: var(--Grey-900, #101828); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.sub-mode-opt:focus-visible{ outline: 2px solid var(--text-link-teal, #25594D); outline-offset: 1px; }
.sub-mode-note{ margin: 6px 2px 0; font-size: 12px; line-height: 1.4; color: var(--Grey-600, #475467); text-align: center; }
.sub-mode-note img{ height: 13px; vertical-align: -2px; margin-left: 2px; }
.sub-mode-broker{ margin: 2px 2px 0; font-size: 12px; line-height: 1.4; color: var(--Grey-600, #475467); text-align: center; }
.sub-mode-broker a{ color: var(--text-link-teal, #25594D); font-weight: 600; text-decoration: none; margin-left: 8px; }
.sub-mode-broker a:hover{ text-decoration: underline; }

/* "See how it works": portrait walkthrough clip in a native dialog */
.sub-mode-video{ display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px auto 0; border: 0; background: none; padding: 4px 6px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-link-teal, #25594D); cursor: pointer; }
.sub-mode-video:hover{ text-decoration: underline; }
.hiw{ position: fixed; inset: 0; margin: auto; padding: 0; border: 0; border-radius: 24px; background: #0d0b10; overflow: visible; width: fit-content; height: fit-content; max-height: 92vh; }
.hiw::backdrop{ background: rgba(20, 16, 24, .7); }
.hiw video{ display: block; height: min(844px, 88vh); width: auto; max-width: 92vw; border-radius: 24px; background: #000; }
.hiw-close{ position: absolute; z-index: 1; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #101828; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
