#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: 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: 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;
}