@font-face {
    font-family: 'Arya';
    src: url('resources/tnof/Arya-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Arya';
    src: url('resources/tnof/Arya-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-main: 'Arya', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --accent: #3ecb1ebf;
    --accent-darker: #32a86fbf;
    --danger: #c43131;
    --danger-bg: rgba(196, 49, 49, 0.12);
    --danger-border: rgba(196, 49, 49, 0.28);
    --success: #1d8f47;
    --success-bg: rgba(29, 143, 71, 0.12);
    --success-border: rgba(29, 143, 71, 0.28);
    --bg-color: #ffffff;
    --text-main: #000000;
    --text-secondary: rgba(0, 0, 0, 0.7);
    --text-muted: rgba(0, 0, 0, 0.5);
    --border-color: rgba(0, 0, 0, 0.1);
    --blur-container-bg: rgba(255, 255, 255, 0.4);
    --blur-container-bg-two: rgba(255, 255, 255, 0.6);
    --blur-container-bg-three: rgba(255, 255, 255, 0.82);
    --nav-height: 56px;
    --side-nav-width: 290px;
    --bg-main: url('resources/MAIN.svg');
}

html[data-theme="dark"],
body.dark-mode {
    --bg-color: #000000;
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --blur-container-bg: rgba(0, 0, 0, 0.4);
    --blur-container-bg-two: rgba(0, 0, 0, 0.6);
    --blur-container-bg-three: rgba(0, 0, 0, 0.8);
    --danger-bg: rgba(196, 49, 49, 0.18);
    --danger-border: rgba(196, 49, 49, 0.36);
    --success-bg: rgba(29, 143, 71, 0.18);
    --success-border: rgba(29, 143, 71, 0.36);
}

html,
body {
    width: 100%;
    min-height: 100vh;
}

html {
    background-color: var(--bg-color);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.avatar-modal-open {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

.sr-only-field {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#app {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.background-layer {
    position: fixed;
    inset: 0;
    background-image: var(--bg-main);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

.texture-layer {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

.texture-light {
    background-image: url('resources/wall-light.svg');
}

.texture-dark {
    background-image: url('resources/wall-dark.svg');
    opacity: 0;
}

html[data-theme="dark"] .texture-light,
body.dark-mode .texture-light {
    opacity: 0;
}

html[data-theme="dark"] .texture-dark,
body.dark-mode .texture-dark {
    opacity: 0;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 250;
    height: var(--nav-height);
    padding: 0 12px 0 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--blur-container-bg-three);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 18px rgba(0, 0, 0, 0.04);
}

.site-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0.7rem 0.4rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
}

.site-nav__back:hover:not(.is-disabled) {
    color: var(--text-main);
    background: var(--blur-container-bg-two);
}

.site-nav__back.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

.site-nav__back--side {
    display: none;
}

.site-nav__logo {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    flex-shrink: 0;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.15s ease;
}

.site-nav__logo:hover {
    opacity: 0.75;
}

.site-nav__logo-wordmark {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.green-r {
    display: inline-flex;
    align-items: baseline;
    color: var(--accent);
}

.green-r__suffix {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-0.15em);
    transition: max-width 0.35s ease, opacity 0.2s ease, transform 0.35s ease;
}

.site-nav__logo:hover .green-r__suffix,
.site-nav__logo:focus-visible .green-r__suffix {
    max-width: 5em;
    opacity: 1;
    transform: translateX(0);
}

.site-nav__actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.site-nav__layout-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.0625rem 0.5rem;
    border-radius: 0.3rem;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.site-nav__layout-toggle:hover,
.site-nav__layout-toggle:focus-visible {
    outline: none;
    transform: scale(1.02);
    background: var(--blur-container-bg-three);
    border-color: rgba(62, 203, 30, 0.35);
}

.site-nav__layout-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 999px;
    color: var(--text-main);
    background: var(--blur-container-bg-two);
    cursor: pointer;
    transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.theme-toggle--nav-mobile {
    display: none;
}

.theme-toggle:hover {
    opacity: 0.85;
    background: var(--blur-container-bg-three);
    border-color: rgba(62, 203, 30, 0.35);
}

.theme-toggle:focus-visible {
    outline: 2px solid rgba(62, 203, 30, 0.35);
    outline-offset: 3px;
}

.theme-toggle__icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
}

.theme-toggle__svg {
    width: 100%;
    height: 100%;
    display: block;
}

.theme-toggle__svg--dark {
    width: 90%;
    height: 90%;
    margin: auto;
}

.site-nav__center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 0rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.site-nav__link:hover {
    color: var(--text-main);
    background: var(--blur-container-bg-two);
}

.site-nav__link.is-active,
.site-nav__link[aria-current="page"] {
    color: var(--text-main);
    background: rgba(62, 203, 30, 0.14);
}

.account-shell {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding: var(--nav-height) 0 0;
}

body[data-nav-layout="side"] .site-nav {
    right: auto;
    bottom: 0;
    width: var(--side-nav-width);
    height: 100vh;
    padding: 1rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
    border-bottom: none;
    border-right: 1px solid var(--border-color);
}

body[data-nav-layout="side"] .site-nav__logo {
    margin-left: 0;
}

body[data-nav-layout="side"] .site-nav__center {
    position: static;
    left: auto;
    transform: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0rem;
}

body[data-nav-layout="side"] .site-nav__center .site-nav__back {
    display: none;
}

body[data-nav-layout="side"] .site-nav__link {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 0.25rem;
    border-radius: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

body[data-nav-layout="side"] .site-nav__link:last-of-type {
    border-bottom: none;
}

body[data-nav-layout="side"] .site-nav__back--side {
    display: inline-flex;
    justify-content: center;
    padding: 0.55rem;
}

body[data-nav-layout="side"] .site-nav__back--side span {
    display: none;
}

body[data-nav-layout="side"] .site-nav__actions {
    margin-left: 0;
    margin-top: auto;
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

body[data-nav-layout="side"] .site-nav__layout-toggle {
    width: auto;
    min-width: 0;
    justify-content: center;
}

body[data-nav-layout="side"] .site-nav__back--side,
body[data-nav-layout="side"] .site-nav__link,
body[data-nav-layout="side"] .theme-toggle {
    flex-shrink: 0;
}

body[data-nav-layout="side"] .account-shell {
    padding: 0 0 0 var(--side-nav-width);
}

.account-frame {
    width: 100%;
    min-height: calc(100vh - var(--nav-height));
    margin: 0;
    overflow: visible;
}

body[data-nav-layout="side"] .account-frame {
    width: 100%;
    min-height: 100vh;
    margin: 0;
}

.account-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    grid-template-areas: "main sidebar";
    gap: 0;
    align-items: stretch;
}

.account-sidebar,
.account-main-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.app-view[hidden] {
    display: none !important;
}

.app-view[hidden] {
    display: none !important;
}

.account-sidebar {
    grid-area: sidebar;
    border-left: 1px solid var(--border-color);
    border-right: none;
}

.account-main-column {
    grid-area: main;
}

.surface-card {
    background: var(--blur-container-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.account-frame.surface-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

body[data-nav-layout="side"] .account-frame.surface-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.account-summary-card,
.settings-card {
    padding: 1.25rem 1.35rem;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.account-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    min-height: 100%;
}

.account-main-column > .settings-card + .settings-card {
    border-top: 1px solid var(--border-color);
}

.section-eyebrow {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--border-color);
    border-radius: 999px;
    padding: 0.0625rem 0.5rem;
    width: fit-content;
    cursor: default;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.account-avatar-action {
    margin-left: auto;
    align-self: center;
}

.account-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-darker));
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    box-shadow: 0 14px 30px rgba(62, 203, 30, 0.18);
    overflow: hidden;
}

.account-avatar.has-image,
.company-member__avatar.has-image {
    background: transparent;
    color: transparent;
    box-shadow: none;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-identity {
    min-width: 0;
}

.account-title,
.panel-title {
    font-size: clamp(1.35rem, 2vw, 1.25rem);
    line-height: 1.3;
    cursor: default;
    margin-top: 0.25rem;
}

.account-subtitle,
.panel-copy,
.danger-copy {
    color: var(--text-secondary);
    line-height: 1.3;
    cursor: default;
    font-size: 0.9rem;
    font-weight: 400;
}

.account-subtitle {
    margin-top: 0rem;
    word-break: break-word;
}

.inline-status {
    padding: 0.25rem 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    color: var(--text-secondary);
}

.inline-status.error,
.inline-status.is-error {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
}

.inline-status.is-success {
    border-color: var(--success-border);
    background: var(--success-bg);
    color: var(--success);
}

.app-toast {
    position: fixed;
    top: calc(var(--nav-height) + 1rem);
    right: clamp(1rem, 3vw, 2rem);
    z-index: 2000;
    width: min(28rem, calc(100vw - 2rem));
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-three);
    color: var(--text-secondary);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
    line-height: 1.45;
    pointer-events: none;
}

.app-toast.is-error {
    border-color: var(--danger-border);
    background: rgba(196, 49, 49, 0.16);
    color: var(--danger);
}

.app-toast.is-success {
    border-color: var(--success-border);
    background: rgba(29, 143, 71, 0.16);
    color: var(--success);
}

html[data-theme="dark"] .app-toast,
body.dark-mode .app-toast {
    background: rgba(0, 0, 0, 0.72);
}

html[data-theme="dark"] .app-toast.is-error,
body.dark-mode .app-toast.is-error {
    background: rgba(196, 49, 49, 0.2);
}

html[data-theme="dark"] .app-toast.is-success,
body.dark-mode .app-toast.is-success {
    background: rgba(29, 143, 71, 0.2);
}

@media (max-width: 768px) {
    .app-toast {
        top: calc(var(--nav-height) + 0.85rem);
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.verification-actions {
    margin-top: 0.75rem;
    width: 100%;
}

.verification-resend-button {
    width: 100%;
    justify-content: center;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.text-button {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 0.4rem;
    padding: 0.25rem 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.secondary-button,
.ghost-button {
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-three);
    color: var(--text-main);
}

.text-button {
    padding: 0.4rem 0.6rem;
    border: none;
    background: transparent;
    color: var(--text-main);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 0rem;
    flex: 0 0 auto;
    border: none;
    border-radius: 0.5rem;
    background: none;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-button svg {
    width: 1.05rem;
    height: 1.05rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.danger-button {
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.text-button:hover,
.icon-button:hover {
    transform: scale(1.02);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.ghost-button:disabled,
.text-button:disabled,
.icon-button:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.account-embedded-section {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.account-embedded-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.account-access-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0rem;
    margin-bottom: 0.25rem;
    cursor: default;
}

.account-access-copy {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.account-summary-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.avatar-modal[hidden] {
    display: none !important;
}

.avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.avatar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 18, 0.52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.avatar-modal__panel {
    position: relative;
    z-index: 1;
    width: min(32rem, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.avatar-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.avatar-modal__close {
    flex: 0 0 auto;
}

.avatar-cropper {
    position: relative;
    width: min(100%, 20rem);
    margin: 0 auto;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.avatar-cropper::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: inherit;
    pointer-events: none;
}

.avatar-cropper__canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

.avatar-cropper__canvas.is-dragging {
    cursor: grabbing;
}

.avatar-modal .field-group label,
.avatar-modal .field-helper {
    margin-left: 0;
}

.avatar-modal__actions {
    justify-content: flex-end;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.tag-row:empty {
    display: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0rem 0.4rem;
    height: 1.1rem;
    border-radius: 0.25rem;
    border: none;
    background: rgba(62, 203, 30, 0.14);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: default;
    line-height: 1;
}

.tag--muted {
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    color: var(--text-secondary);
}

.tag--danger {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
}

.tag--success {
    border-color: var(--success-border);
    background: var(--success-bg);
    color: var(--success);
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

.panel-header__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.company-roster-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
}

.company-roster-filters-panel {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: min(100%, 40rem);
    margin-inline: auto;
}

.company-roster-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 14rem);
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.company-roster-filters__field input,
.company-roster-filters__field .custom-select__trigger {
    min-height: 2.45rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.company-roster-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--blur-container-bg-two);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex: 0 0 auto;
}

.company-roster-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.15rem 0.8rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.company-roster-view-button:hover,
.company-roster-view-button:focus-visible {
    outline: none;
    color: var(--text-main);
    transform: translateY(-1px);
}

.company-roster-view-button.is-active {
    background: var(--blur-container-bg-three);
    color: var(--text-main);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .company-roster-view-toggle,
body.dark-mode .company-roster-view-toggle {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 22px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .company-roster-view-button,
body.dark-mode .company-roster-view-button {
    color: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .company-roster-view-button:hover,
html[data-theme="dark"] .company-roster-view-button:focus-visible,
body.dark-mode .company-roster-view-button:hover,
body.dark-mode .company-roster-view-button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

html[data-theme="dark"] .company-roster-view-button.is-active,
body.dark-mode .company-roster-view-button.is-active {
    background: rgba(62, 203, 30, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(62, 203, 30, 0.26), 0 12px 24px rgba(0, 0, 0, 0.34);
}

.profile-edit-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    flex: 0 0 auto;
    border: none;
    background: none;
    padding: 0;
    transition: transform 0.15s ease, color 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
}

.profile-edit-action svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-edit-action:hover,
.profile-edit-action:focus-visible {
    color: var(--text-main);
    outline: none;
    transform: scale(1.02);
    opacity: 0.85;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
    background: var(--blur-container-bg-two);
    margin-bottom: 1rem;
}

.detail-grid--compact {
    margin-bottom: 0;
}

.detail-card {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    padding: 0.25rem 0.68rem;
    border-top: 1px solid var(--border-color);
    min-width: 0;
}

.detail-card:first-child {
    border-top: none;
}

.detail-card--editable {
    gap: 0.35rem;
}

.detail-card__label {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.detail-card__value {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

.detail-grid--compact .detail-card {
    padding: 0.4rem 0.68rem;
}

.detail-grid--compact .detail-card__label {
    font-size: 0.62rem;
}

.detail-grid--compact .detail-card__value {
    font-size: 0.84rem;
}

.detail-card__input {
    width: 100%;
    font-family: var(--font-main);
    font-weight: 400;
    border: 1px solid var(--border-color);
    border-radius: 0.38rem;
    background: var(--input-bg);
    color: var(--text-main);
    padding: 0.52rem 0.62rem;
    font-size: 0.88rem;
    line-height: 1.25;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.detail-card__input::placeholder {
    color: var(--text-muted);
}

.detail-card__input:focus {
    outline: none;
    border-color: rgba(62, 203, 30, 0.45);
    box-shadow: 0 0 0 2px rgba(62, 203, 30, 0.12);
}

.detail-card--actions {
    padding-top: 0.5rem;
    padding-bottom: 0.15rem;
}

.detail-card__hint {
    margin: 0;
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.32;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    margin-top: 0.25rem;
}

.setting-item--member {
    padding: 0.55rem 0.6rem;
}

.setting-item--member-compact {
    padding: 0.5rem 0.55rem;
    background: var(--blur-container-bg);
}

.company-roster-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.company-roster-group:first-child {
    margin-top: 0;
}

.company-roster-group__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.company-roster-group__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.1;
    color: var(--text-main);
}

.company-roster-group__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.company-tree {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.25rem;
}

.company-tree > .company-roster-filters-panel {
    width: min(100%, 40rem);
    margin: 0.75rem auto 0.25rem;
}

.company-tree__company-card {
    width: min(100%, 24rem);
    margin: 0 auto;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(62, 203, 30, 0.24);
    border-radius: 1rem;
    background: var(--blur-container-bg-three);
    text-align: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06);
}

.company-roster-summary-card {
    margin-bottom: 0;
}

.company-tree__company-title,
.company-tree__role-title {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.15;
    color: var(--text-main);
}

.company-tree__company-copy {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.86rem;
}

.company-tree__level {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0;
}

.company-tree__level + .company-tree__level {
    margin-top: 0;
}

.company-tree__node {
    position: relative;
    display: flex;
    justify-content: center;
    flex: 0 1 17rem;
    min-width: min(100%, 14rem);
}

.company-tree__role-card {
    width: min(100%, 17rem);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--blur-container-bg-two);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.05);
}

.company-tree__role-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.company-tree__members {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.company-tree__members .setting-item {
    margin-top: 0;
}

.company-tree__level--connected {
    padding-top: 1rem;
}

.company-tree__company-card {
    position: relative;
}

.company-tree__level--leadership {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.company-tree__company-card + .company-tree__level--leadership {
    margin-top: 0;
}

/* SVG connector lines container */
.company-tree__connectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.company-tree__connectors line {
    stroke: var(--border-color);
    stroke-width: 1;
}

.company-roster-more {
    align-self: flex-start;
    margin-top: 0.35rem;
}

.company-member__identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
}

.company-member__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
    overflow: hidden;
}

.session-item {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    margin-top: 0.25rem;
}

.session-item:last-child {
    margin-bottom: 0.5rem;
}

.verification-card {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--blur-container-bg-two);
    margin-top: 0.125rem;
}

.verification-card {
    transform-origin: top center;
}

.verification-card[hidden] {
    display: none !important;
}

.verification-card.is-revealed {
    animation: verification-card-reveal 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.setting-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.2rem;
}

.session-item__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    column-gap: 0.5rem;
}

.setting-item__info,
.session-item__info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.session-item__info {
    flex: 1 1 auto;
}

.session-item__heading {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
}

.setting-item__title,
.verification-copy h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin: 0;
    padding: 0;
    margin-bottom: 0.5rem;
}

.session-item__heading .session-item__title {
    margin-bottom: 0;
}

.session-item__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin: 0;
    padding: 0;
    margin-bottom: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

.setting-item__meta,
.session-item__meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item__heading .session-item__meta::before {
    content: '|';
    margin-right: 0.35rem;
    color: var(--text-muted);
}

.verification-copy p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.password-strength-row,
.password-strength-hint {
    font-size: 0.82rem;
}

.password-strength {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    background: var(--blur-container-bg-two);
}

.password-strength-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.password-strength-label {
    color: var(--text-main);
    font-weight: 700;
}

.password-strength-bar {
    height: 0.42rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--border-color);
}

.password-strength-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--text-muted);
    transition: width 0.2s ease, background 0.2s ease;
}

.password-strength-hint {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.password-strength[data-strength="weak"] .password-strength-fill {
    background: linear-gradient(90deg, #ff5d5d 0%, #f97316 100%);
}

.password-strength[data-strength="fair"] .password-strength-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #facc15 100%);
}

.password-strength[data-strength="good"] .password-strength-fill {
    background: linear-gradient(90deg, #6ccf57 0%, #a7e56b 100%);
}

.password-strength[data-strength="strong"] .password-strength-fill {
    background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}

.session-item__details {
    display: grid;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.session-item__actions,
.setting-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.session-item__actions {
    align-self: flex-start;
    min-width: max-content;
}

.session-item--meta-expanded .session-item__top {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
}

.session-item--meta-expanded .session-item__heading,
.session-item--meta-expanded .session-item__meta {
    overflow: visible;
}

.session-item--meta-expanded .session-item__meta {
    text-overflow: clip;
}

.session-item--meta-expanded .session-item__actions {
    display: none;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form--inline .button-row {
    align-items: flex-end;
}

@keyframes verification-card-reveal {
    from {
        opacity: 0;
        transform: translateY(0.6rem) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

.field-group[hidden] {
    display: none !important;
}

.field-group label,
.checkbox-row {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0;
    margin: 0;
    margin-left: 1rem;
}

.field-group input,
.field-group select {
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 0.25rem 0.9rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.field-group input[type="file"] {
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}

.field-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--accent);
}

body.dark-mode .field-group input,
body.dark-mode .field-group select {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .field-group input:focus,
body.dark-mode .field-group select:focus {
    background: rgba(255, 255, 255, 0.08);
}

.company-roster-filters__field input,
body.dark-mode .company-roster-filters__field input {
    background: var(--blur-container-bg-two);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.company-roster-filters__field input:hover,
.company-roster-filters__field input:focus,
body.dark-mode .company-roster-filters__field input:hover,
body.dark-mode .company-roster-filters__field input:focus {
    background: var(--blur-container-bg-three);
}

.field-group select {
    appearance: auto;
    cursor: pointer;
}

.field-helper {
    margin: 0.1rem 0 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.custom-select {
    position: relative;
}

.custom-select__trigger {
    width: 100%;
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    background: var(--blur-container-bg-two);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.custom-select__trigger:hover:not(:disabled) {
    background: var(--blur-container-bg-three);
}

.custom-select__trigger:focus-visible,
.custom-select.is-open .custom-select__trigger {
    outline: none;
    border-color: var(--accent);
    background: var(--blur-container-bg-three);
}

.custom-select__trigger:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.custom-select__value {
    min-width: 0;
    flex: 1;
}

.custom-select__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.custom-select__icon svg {
    width: 100%;
    height: 100%;
}

.custom-select.is-open .custom-select__icon {
    transform: rotate(180deg);
    color: var(--text-main);
}

.custom-select__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--blur-container-bg-two);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.custom-select__menu[hidden] {
    display: none !important;
}

.custom-select__search-shell {
    padding-bottom: 0.15rem;
}

.custom-select__search {
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.88rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 0.35rem;
    background: var(--blur-container-bg-three);
    color: var(--text-main);
}

.custom-select__search::placeholder {
    color: var(--text-muted);
}

.custom-select__search:focus {
    outline: none;
    border-color: var(--accent);
}

.custom-select__options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 12rem;
    overflow-y: auto;
}

.custom-select__empty {
    padding: 0.5rem 0.65rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.custom-select__option {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.custom-select__option:hover,
.custom-select__option:focus-visible {
    outline: none;
    background: var(--blur-container-bg-three);
    border-color: var(--border-color);
}

.custom-select__option.is-selected {
    background: rgba(62, 203, 30, 0.14);
    border-color: rgba(62, 203, 30, 0.22);
}

.form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--single {
    grid-template-columns: 1fr;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.checkbox-row input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.danger-card code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
}

@media (max-width: 1024px) {
    .account-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "main";
    }

    .account-sidebar {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .primary-button,
    .secondary-button,
    .danger-button,
    .ghost-button {
        font-size: 0.81rem;
        padding: 0.1875rem 0.75rem;
    }

    .field-group input,
    .field-group select {
        font-size: 1rem;
    }

    .green-r__suffix {
        display: none !important;
    }

    .site-nav {
        gap: 8px;
        padding: 0 0.5rem 0 12px;
    }

    .site-nav__actions,
    .site-nav__layout-toggle,
    .site-nav__back--side {
        display: none !important;
    }

    .site-nav__center {
        position: static;
        left: auto;
        transform: none;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-start;
        gap: 1px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .site-nav__center::-webkit-scrollbar {
        display: none;
    }

    .site-nav__center > * {
        flex-shrink: 0;
    }

    .theme-toggle--nav-mobile {
        display: inline-flex;
        width: 34px;
        height: 34px;
        margin-left: 0.35rem;
        border-radius: 0.45rem;
        flex-shrink: 0;
    }

    .site-nav__back {
        padding: 0.45rem;
    }

    .site-nav__back span {
        display: none;
    }

    .site-nav__link {
        padding: 0.25rem 0.58rem;
    }

    .site-nav__actions {
        flex-shrink: 0;
    }

    .account-shell {
        padding: var(--nav-height) 0 0;
    }

    .account-summary-card,
    .settings-card {
        padding: 1.05rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .company-roster-toolbar {
        justify-content: flex-start;
    }

    .company-roster-filters {
        grid-template-columns: 1fr;
    }

    .company-roster-view-toggle {
        width: 100%;
    }

    .company-roster-view-button {
        flex: 1 1 0;
    }

    .setting-item__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding-bottom: 0;
    }

    .session-item__top {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .setting-item__title {
        margin-bottom: 0.25rem;
    }

    .setting-item .tag-row {
        margin-top: 0.25rem;
    }

    .company-tree__level {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding-top: 0;
    }

    .company-tree__level--leadership {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        width: min(100%, 35rem);
        gap: 0.85rem;
    }

    .company-tree > .company-tree__company-card::after,
    .company-tree__level--connected::before,
    .company-tree__level--connected::after,
    .company-tree__level--connected > .company-tree__node::before {
        display: none;
    }

    .company-tree__node,
    .company-tree__role-card {
        width: 100%;
        max-width: none;
    }

    .account-header {
        flex-direction: row;
        align-items: center;
    }

    .account-avatar {
        width: 3.3rem;
        height: 3.3rem;
        font-size: 1.25rem;
    }
}
