#contentwrap {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

#domain-portfolio-header {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex-shrink: 0;
}

#domain-portfolio-table .dtcard {
    height: 100%;
    max-height: 100%;
    min-height: 300px;
}

#domain-portfolio-footer {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#domain-portfolio-header {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#domain-portfolio-filters {
    width: 100%;
    flex-shrink: 0;
}

.control-cell img {
    max-width: 20px;
    max-height: 20px;
}

.btn-active:hover,
.btn-active {
    background-color: #000;
    color: #FFFFFF;
}

/* Portfolio-specific layout overrides */
body {
    overflow: hidden;
}

#contentwrap {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#appheader {
    flex-shrink: 0;
}

#content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    gap: 10px;
}

#domain-portfolio-header {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex-shrink: 0;
}

#domain-portfolio-table {
	width: 100%;
    border: 1px solid #EEE;
    padding: 10px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

#domain-portfolio-table .dtcard {
    height: 100%;
    max-height: 100%;
    min-height: 300px;
}

#domain-portfolio-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.btn-active:hover,
.btn-active {
    background-color: #000;
    color: #FFFFFF;
}

.control-cell img {
    max-width: 20px;
    max-height: 20px;
}

.btn-lookup-domain-row {
	cursor: pointer;
}

/* =========================================================================
   Member Of column — pill styling
   Mirrors .domain-status-span pattern, distinct colour for category pills.
   ========================================================================= */

.datatable td > .td-content > span.member-of-span {
    background-color: transparent;
    display: flex;
    flex-direction: row;
    flex-wrap: no-wrap;
    gap: 5px;
    width: auto;
}

.member-of-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #ddeeff;
    color: #000000;
    padding: 0 4px 0 5px;
    border-radius: 3px;
    font-size: 90%;
    box-shadow: var(--subtle-box-shadow);
}

.member-of-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 0 1px;
    color: #667;
    border-radius: 2px;
    transition: background 0.1s, color 0.1s;
}

.member-of-remove:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #000;
}

/* Dark mode */
body.dark-mode .member-of-pill {
    background-color: #1e3a5f;
    color: #cce4ff;
}

body.dark-mode .member-of-remove {
    color: #6699bb;
}

body.dark-mode .member-of-remove:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

body.dark-mode #domain-portfolio-table {
    border: 1px solid #2e2e3e ;
}

.lookup-in-progress {
    opacity: 0.4;
    animation: lookup-pulse 1s ease-in-out infinite;
}

@keyframes lookup-pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1;   }
}

/* =========================================================================
   Category header — overflow handling
   ========================================================================= */

#domain-portfolio-header {
    max-height: 116px; /* 3 rows of 32px + 2 gaps of 10px */
    overflow: hidden;
}

/* +N more button — same style as category buttons but with distinct marker */
.cat-overflow-more-btn {
    font-style: italic;
}

/* =========================================================================
   Overflow dropdown
   ========================================================================= */

.cat-overflow-dropdown {
    position: absolute;
    z-index: 1200;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.cat-overflow-dropdown::-webkit-scrollbar       { width: 5px; }
.cat-overflow-dropdown::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.cat-overflow-item {
    display: block;
    width: 100%;
    padding: 7px 12px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #1a1a1a;
    white-space: nowrap;
    transition: background 0.12s;
}

.cat-overflow-item:hover {
    background: #f0f0f0;
}

.cat-overflow-item.btn-active {
    background: #000;
    color: #fff;
}

/* =========================================================================
   Dark mode
   ========================================================================= */

body.dark-mode .cat-overflow-dropdown {
    background: #1e1e2e;
    border-color: #2e2e3e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .cat-overflow-item {
    color: #e0e0e0;
}

body.dark-mode .cat-overflow-item:hover {
    background: #26263a;
}

body.dark-mode .cat-overflow-item.btn-active {
    background: #000;
    color: #fff;
}

/* =========================================================================
   Category header — overflow handling
   max-height is managed by JS (_applyHeaderOverflow), not CSS.
   ========================================================================= */

/* Narrow screen — clamp button width and truncate long names */
@media (max-width: 600px) {
    .btn-cat-selector {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* +N more button — italic to distinguish from regular category buttons */
.cat-overflow-more-btn {
    font-style: italic;
}

/* =========================================================================
   Overflow dropdown
   ========================================================================= */

.cat-overflow-dropdown {
    /* position, top, left, width, max-height set dynamically by JS */
    z-index: 1200;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.cat-overflow-dropdown::-webkit-scrollbar       { width: 5px; }
.cat-overflow-dropdown::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.cat-overflow-item {
    display: block;
    width: 100%;
    padding: 7px 12px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #1a1a1a;
    white-space: nowrap;
    transition: background 0.12s;
}

.cat-overflow-item:hover {
    background: #f0f0f0;
}

.cat-overflow-item.btn-active {
    background: #000;
    color: #fff;
}

/* =========================================================================
   Dark mode
   ========================================================================= */

body.dark-mode .cat-overflow-dropdown {
    background: #1e1e2e;
    border-color: #2e2e3e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .cat-overflow-item {
    color: #e0e0e0;
}

body.dark-mode .cat-overflow-item:hover {
    background: #26263a;
}

body.dark-mode .cat-overflow-item.btn-active {
    background: #000;
    color: #fff;
}

/* =========================================================================
   Nameservers summary virtual column
   ========================================================================= */

.datatable td > .td-content > span.ns-summary-span {
    background-color: transparent;
    display: flex;
    flex-direction: row;
    flex-wrap: no-wrap;
    gap: 4px;
    width: auto;
}

.ns-summary-pill {
    display: inline-flex;
    align-items: center;
    background-color: #eef2ff;
    color: #3730a3;
    padding: 0 6px;
    border-radius: 3px;
    font-size: 90%;
    font-family: var(--default-monospace);
    box-shadow: var(--subtle-box-shadow);
}

/* Dark mode */
body.dark-mode .ns-summary-pill {
    background-color: #1e1e4f;
    color: #a5b4fc;
}


.domain-portfolio-header-left {
	position: fixed;
    left: 0;
    width: 200px !important;
    bottom: 0;
    top: 0;
    height: 100%;
    padding: 10px 5px;
	max-height: none !important;
	align-content: flex-start;
	overflow-y: auto;
}

.domain-portfolio-header-left .btn-cat-selector {
	width: 100%;
	text-align: left;
	margin-bottom: 3px;
}

.domain-portfolio-header-left .domain-portfolio-header-buttons {
	overflow-y: auto;
	height: 100%;
	display: block;
	padding: 2px 4px 2px 2px;
}

.domain-portfolio-header-top .domain-portfolio-header-buttons {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}


/* =========================================================================
   Category bar toggle button in footer
   ========================================================================= */

.pf-category-toggle-btn,
.pf-filter-toggle-btn {
    opacity: 0.45;
    transition: opacity 0.15s;
}

.pf-category-toggle-active,
.pf-filter-toggle-active {
    opacity: 1;
}
/* =========================================================================
   Curated List button — uses standard btn-success btn-cat-selector styling
   ========================================================================= */

/* =========================================================================
   Curated List dialog
   ========================================================================= */

.curated-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.curated-modal {
    background: var(--panel-background-color, #fff);
    border: 1px solid var(--splitter-color, #ddd);
    border-radius: var(--default-border-radius, 5px);
    width: 480px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.curated-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--splitter-color, #eee);
}

.curated-modal-title {
    font-family: var(--default-label-font);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--subheading-text-color);
}

.curated-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--subheading-text-color);
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
}

.curated-modal-close:hover {
    background: var(--header-background-color);
}

.curated-modal-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.curated-modal-hint {
    font-size: 12px;
    color: var(--subheading-text-color);
    margin: 0;
}

.curated-list-textarea {
    width: 100%;
    height: 200px;
    box-sizing: border-box;
    font-family: var(--default-monospace, monospace);
    font-size: 13px;
    border: 1px solid var(--form-control-border-color);
    border-radius: var(--default-border-radius);
    background: var(--form-control-background-color);
    color: var(--form-control-color);
    padding: 8px;
    resize: vertical;
    margin: 0;
}

.curated-list-textarea:focus {
    outline: none;
    border-color: var(--form-control-border-focus-color);
    box-shadow: 0 0 0 2px rgba(128, 189, 255, 0.2);
}

.curated-modal-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--splitter-color, #eee);
}

/* Dark mode */
body.dark-mode .curated-modal {
    background: var(--panel-background-color);
    border-color: var(--splitter-color);
}

body.dark-mode .curated-modal-header,
body.dark-mode .curated-modal-footer {
    border-color: var(--splitter-color);
}

/* =========================================================================
   Filter bar toggle button in footer
   ========================================================================= */

.pf-filter-btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
}
/* =========================================================================
   Sticky columns
   ========================================================================= */

#domain-portfolio-table .dtcard-body {
    overflow-x: auto;
}

/* Eliminate cell spacing gaps that allow scrolled content to bleed through */
#dp-table {
    border-spacing: 0;
}

#dp-table td {
    padding-bottom: 0;
    vertical-align: middle;
}

.th-ctrl > .th-content {
    padding: 0px 20px 0px 12px !important;
    width: 20px;

}

.datatable th.th-sticky,
.datatable td.td-sticky {
    border-right: 0px solid #FAFAFA !important;
}

.datatable thead th.th-sticky {
    position: sticky;
    z-index: 3;
    background: #f5f5f5 !important;
}

.datatable tbody td.td-sticky {
    position: sticky;
    z-index: 2;
    background: #ffffff !important;
}

.datatable tbody tr:nth-child(even) td.td-sticky {
    background: #f9f9f9 !important;
}

.datatable tbody tr:hover td.td-sticky {
    background: #f0f4ff !important;
}

.datatable tbody tr.tr-selected td.td-sticky {
    background: #e8f0fe !important;
}

body.dark-mode .datatable th.th-sticky,
body.dark-mode .datatable td.td-sticky {
    border-right: 0px solid #2e2e3e !important;
}

body.dark-mode .datatable thead th.th-sticky {
    background: #1e1e2e !important;
}

body.dark-mode .datatable tbody td.td-sticky {
    background: #12121e !important;
}

body.dark-mode .datatable tbody tr:nth-child(even) td.td-sticky {
    background: #1a1a2a !important;
}

body.dark-mode .datatable tbody tr:hover td.td-sticky {
    background: #26263a !important;
}

.datatable .td-content.domain-cell {
    user-select: text;
    cursor: text;
}