body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
}

pre {
    overflow-x: scroll;
    max-width: 100%;
    white-space: break-spaces;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgb(82, 56, 120);
    color: #fff;
    padding: 1rem 0;
}

header img {
    height: 60px;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav a {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

nav a:hover {
    color: rgb(196 166 227);
    transition: color 0.2s ease;
}

.menu-icon-prompt,
.menu-icon-analyse,
.menu-icon-character,
.menu-icon-video,
.menu-icon-configure,
.menu-icon-user,
.menu-icon-logout {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    flex: 0 0 1rem;
    background-color: currentColor;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
}

.menu-icon-dollar {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    flex: 0 0 5rem;
    background-color: white;
}

.menu-icon-prompt {
    mask: url("/assets/images/icons/money-check-pen-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/money-check-pen-regular-full.svg") center / contain no-repeat;
}

.menu-icon-analyse {
    mask: url("/assets/images/icons/magnifying-glass-chart-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/magnifying-glass-chart-regular-full.svg") center / contain no-repeat;
}

.menu-icon-character {
    mask: url("/assets/images/icons/address-book-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/address-book-regular-full.svg") center / contain no-repeat;
}

.menu-icon-video {
    mask: url("/assets/images/icons/video-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/video-regular-full.svg") center / contain no-repeat;
}

.menu-icon-configure {
    mask: url("/assets/images/icons/wrench-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/wrench-regular-full.svg") center / contain no-repeat;
}

.menu-icon-user {
    mask: url("/assets/images/icons/circle-user-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/circle-user-regular-full.svg") center / contain no-repeat;
}

.menu-icon-logout {
    mask: url("/assets/images/icons/person-carry-empty-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/person-carry-empty-regular-full.svg") center / contain no-repeat;
}

.menu-icon-dollar {
    mask: url("/assets/images/icons/circle-dollar-regular-full.svg") center / contain no-repeat;
    -webkit-mask: url("/assets/images/icons/circle-dollar-regular-full.svg") center / contain no-repeat;
}

.desktop-only {
    display: list-item;
}

.mobile-only {
    display: none !important;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 350px;
    background: #ffffff;
    color: #333333;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    z-index: 1000;
    margin-top: 0.5rem;
    box-sizing: border-box;
}

.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.dropdown-usage-section {
    margin-bottom: 0.5rem;
    border: 1px solid #c4a6e3;
    border-radius: 0.5rem;
    background-color: #f4f0fa;
    padding: 1rem;
}

.dropdown-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.dropdown-usage-title {
    font-weight: 600;
    color: rgb(82, 56, 120);
}

.dropdown-usage-numbers {
    color: #666;
    font-size: 0.78rem;
}

.dropdown-usage-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.dropdown-usage-fill {
    height: 100%;
    background: rgb(156, 66, 245);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dropdown-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

nav .dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    justify-content: flex-start;
    background: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

nav .dropdown-menu-item:hover {
    background-color: #f4f0fa;
    color: rgb(82, 56, 120);
}

nav .dropdown-menu-item span[class^="menu-icon-"] {
    background-color: currentColor;
}

nav span.pill {
    font-size: 0.5rem;
}

nav span.pill-dollar {
    font-size: 0.8rem;
}

@media (max-width: 760px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: list-item !important;
    }

    header {
        padding: 0.75rem 0;
    }

    header img {
        height: 48px;
    }

    nav .container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    nav .logo {
        align-self: center;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    nav ul li {
        margin-left: 0;
    }

    nav a {
        justify-content: center;
        padding: 0.45rem 0.65rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        font-size: 0.92rem;
    }

    nav a:hover {
        background: rgba(255, 255, 255, 0.14);
    }

    nav span.pill {
        font-size: 0.45rem;
    }
}

@media (max-width: 430px) {
    nav ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    nav a {
        width: 100%;
        box-sizing: border-box;
        min-height: 42px;
    }
}

main {
    padding: 2rem 0;
    min-height: 80vh;
}

footer {
    position: relative;
    bottom: 0;
    width: 100%;
    color: #aaa;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.9rem;
}

.card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1, h2 {
    color: rgb(82, 56, 120);
}

.btn {
    display: inline-block;
    background: rgb(82, 56, 120);
    color: #fff;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.btn-grey {
    background: #aaa;
}

.btn.is-copied,
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn:hover {
    background: rgb(156, 66, 245);
}

.btn-smaller {
    padding: 0.5rem 1rem;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

form div {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-actions {
    text-align: right;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

hr {
    color: #eee;
    margin: 1rem 0;
    border-top: 1px;
}

p.field-helper-text small {
    border-left: 5px solid #ddd;
    padding-left: 0.5rem;
    display: block;
}

img.reference-image {
    margin: 5px;
    border: 1px solid #ddd;
    max-width: 120px;
    max-height: 120px;
    border-radius: 4px;
    overflow: hidden;
    object-fit: cover;
}

.purple {
    color: rgb(156, 66, 245);
}

div.card-content-box {
    background: #f9f9f9;
    padding: 1rem;
    border-left: 4px solid rgb(156, 66, 245);
    margin-bottom: 2rem;
}

div.card-content-box-green {
    background: #dbf3df;
    border-left: 4px solid rgb(15 119 28);
}

div.card-content-box-blue {
    background: #c5e5ec;
    border-left: 4px solid rgb(15 100 119);
}

div.card-content-box-red {
    background: #ecc5c5;
    border-left: 4px solid rgb(119 15 15);
}

span.pill {
    background: rgb(156, 66, 245);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

span.white-pill {
    background: #c4a6e3;
    color: rgb(82, 56, 120);
}

section.card label {
    font-weight: bold;
    font-size: 0.9rem;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0rem;
    font-size: 0.8rem;
}

.section-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin-top: 4px;
    background-color: rgb(156, 66, 245);
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
}

.section-heading-text {
    display: flex;
    flex-direction: column;
}

.section-title {
    margin: 0;
    line-height: 1.2;
}

.section-description {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #666;
}

span.list-ul-solid-full {
    mask-image: url("/assets/images/icons/list-ul-solid-full.svg");
    -webkit-mask-image: url("/assets/images/icons/list-ul-solid-full.svg");
}

span.camera-viewfinder-regular-full {
    mask-image: url("/assets/images/icons/camera-viewfinder-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/camera-viewfinder-regular-full.svg");
}

span.image-landscape-regular-full {
    mask-image: url("/assets/images/icons/image-landscape-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/image-landscape-regular-full.svg");
}

span.wardrobe-regular-full {
    mask-image: url("/assets/images/icons/wardrobe-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/wardrobe-regular-full.svg");
}

span.person-carry-empty-regular-full {
    mask-image: url("/assets/images/icons/person-carry-empty-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/person-carry-empty-regular-full.svg");
}

span.face-smile-wink-regular-full {
    mask-image: url("/assets/images/icons/face-smile-wink-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/face-smile-wink-regular-full.svg");
}

span.user-hair-long-regular-full {
    mask-image: url("/assets/images/icons/user-hair-long-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/user-hair-long-regular-full.svg");
}

span.lips-regular-full {
    mask-image: url("/assets/images/icons/lips-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/lips-regular-full.svg");
}

span.lightbulb-on-regular-full {
    mask-image: url("/assets/images/icons/lightbulb-on-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/lightbulb-on-regular-full.svg");
}

span.aperture-regular-full {
    mask-image: url("/assets/images/icons/aperture-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/aperture-regular-full.svg");
}

span.circle-small-regular-full {
    mask-image: url("/assets/images/icons/circle-small-regular-full.svg");
    -webkit-mask-image: url("/assets/images/icons/circle-small-regular-full.svg");
}

div.generic-content-box {
    background: #f9f9f9;
    padding: 1rem;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
}

.analysis-overall {
    border: 1px solid rgba(82, 56, 120, 0.45) !important;
    box-shadow:
            0 0 0 4px rgba(156, 66, 245, 0.08),
            0 12px 28px rgba(82, 56, 120, 0.18),
            0 0 34px rgba(156, 66, 245, 0.16);
}

.analysis-result-box {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.analysis-result-content {
    min-width: 0;
    flex: 1;
}

.score-widget {
    --score-colour: hsl(0, 72%, 42%);
    --score-percent: 0%;
    --score-track: #e7e2ec;

    position: relative;
    display: inline-flex;
    flex: 0 0 86px;
    width: 86px;
    height: 86px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 50%;
    color: var(--score-colour);
    background:
            radial-gradient(circle at 50% 50%, #ffffff 0 58%, transparent 59%),
            conic-gradient(
                    from 0deg,
                    var(--score-colour) 0 var(--score-percent),
                    var(--score-track) var(--score-percent) 100%
            );
}

.score-widget::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: inherit;
    background:
            radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.88) 62%, rgba(244, 247, 246, 0.95));
    box-shadow:
            inset 0 2px 4px rgba(255, 255, 255, 0.95),
            inset 0 -5px 10px rgba(0, 0, 0, 0.045);
    z-index: 0;
}

.score-widget::after {
    content: "";
    position: absolute;
    top: 13px;
    left: 19px;
    width: 36px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    transform: rotate(-20deg);
    pointer-events: none;
    z-index: 1;
}

.score-widget-value,
.score-widget-max {
    position: relative;
    z-index: 2;
}

.score-widget-value {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.score-widget-max {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.68;
}

.score-widget-large {
    flex: 0 0 128px;
    width: 128px;
    height: 128px;
    margin: 0.25rem 0.5rem 0.25rem 0;
}

.score-widget-large::before {
    inset: 12px;
}

.score-widget-large::after {
    top: 20px;
    left: 30px;
    width: 52px;
    height: 22px;
}

.score-widget-large .score-widget-value {
    font-size: 3rem;
    font-weight: 800;
}

@supports not (color: color-mix(in srgb, red 50%, white)) {
    .score-widget {
        box-shadow:
                0 10px 22px rgba(0, 0, 0, 0.10),
                0 0 0 4px rgba(0, 0, 0, 0.04),
                inset 0 2px 5px rgba(255, 255, 255, 0.85);
    }
}

@media (max-width: 640px) {
    .analysis-result-box {
        flex-direction: column;
    }

    .score-widget {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }

    .score-widget-value {
        font-size: 1.55rem;
    }
}

span.grey {
    color: #888;
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

body.dark-mode {
    background-color: #121217;
    color: #e4e6eb;
    color-scheme: dark;
}

body.dark-mode header {
    background: #1c1829;
    border-bottom: 1px solid #2e2640;
}

body.dark-mode nav a:hover {
    color: rgb(215, 185, 245);
}

body.dark-mode .nav-dropdown-menu {
    background: #201c2e;
    color: #e4e6eb;
    border: 1px solid #362e4a;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .dropdown-usage-section {
    border: 1px solid #4d3b66;
    background-color: #171322;
}

body.dark-mode .dropdown-usage-title {
    color: #d6b8f8;
}

body.dark-mode .dropdown-usage-numbers {
    color: #a09ab0;
}

body.dark-mode .dropdown-usage-bar {
    background: #332b45;
}

body.dark-mode .dropdown-usage-fill {
    background: rgb(168, 85, 247);
}

body.dark-mode nav .dropdown-menu-item {
    color: #e4e6eb;
}

body.dark-mode nav .dropdown-menu-item:hover {
    background-color: #322b45;
    color: #d6b8f8;
}

body.dark-mode .card {
    background: #1c1c24;
    color: #e4e6eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    border: 1px solid #2c2c38;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #c9a7f5;
}

body.dark-mode h3,
body.dark-mode h4 {
    color: #dcd8ea;
}

body.dark-mode .btn {
    background: rgb(124, 58, 237);
    color: #fff;
}

body.dark-mode .btn:hover {
    background: rgb(147, 51, 234);
}

body.dark-mode .btn-grey {
    background: #4b4858;
    color: #e4e6eb;
}

body.dark-mode .btn.is-copied,
body.dark-mode .btn:disabled {
    opacity: 0.5;
}

body.dark-mode div.card-content-box {
    background: #252430;
    border-left: 4px solid rgb(168, 85, 247);
    color: #e4e6eb;
}

body.dark-mode div.card-content-box-green {
    background: #14281c;
    border-left: 4px solid #34d399;
    color: #a7f3d0;
}

body.dark-mode div.card-content-box-blue {
    background: #142533;
    border-left: 4px solid #38bdf8;
    color: #bae6fd;
}

body.dark-mode div.card-content-box-red {
    background: #33161a;
    border-left: 4px solid #f87171;
    color: #fecaca;
}

body.dark-mode div.generic-content-box {
    background: #242430;
    border: 1px solid #363646;
    color: #e4e6eb;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode textarea,
body.dark-mode select {
    background: #252532;
    color: #f3f4f6;
    border: 1px solid #434358;
}

body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="password"]:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
    outline: none;
}

body.dark-mode p.field-helper-text small {
    border-left: 5px solid #4a485a;
    color: #9ca3af;
}

body.dark-mode hr {
    color: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.1);
    border-top: 1px solid rgba(192, 132, 252, 0.1);
}

body.dark-mode span.grey {
    color: #9ca3af;
}

body.dark-mode .purple {
    color: #c084fc;
}

body.dark-mode span.white-pill {
    background: #3d2f58;
    color: #e9d5ff;
}

body.dark-mode span.pill {
    background: rgb(147, 51, 234);
    color: #fff;
}

body.dark-mode .alert-success {
    background-color: #14281c;
    color: #a7f3d0;
    border-color: #1a432d;
}

body.dark-mode .alert-danger {
    background-color: #33161a;
    color: #fecaca;
    border-color: #552026;
}

body.dark-mode .section-icon {
    background-color: #c084fc;
}

body.dark-mode .section-description {
    color: #9ca3af;
}

body.dark-mode .analysis-overall {
    border: 1px solid rgba(192, 132, 252, 0.45) !important;
    box-shadow:
        0 0 0 4px rgba(192, 132, 252, 0.1),
        0 12px 28px rgba(0, 0, 0, 0.45),
        0 0 34px rgba(192, 132, 252, 0.15);
}

body.dark-mode .score-widget {
    --score-track: #363244;
    background:
        radial-gradient(circle at 50% 50%, #1c1c24 0 58%, transparent 59%),
        conic-gradient(
            from 0deg,
            var(--score-colour) 0 var(--score-percent),
            var(--score-track) var(--score-percent) 100%
        );
}

body.dark-mode .score-widget::before {
    background: radial-gradient(circle at 50% 35%, rgba(45, 43, 58, 0.98), rgba(35, 33, 46, 0.88) 62%, rgba(28, 28, 36, 0.95));
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 0 -5px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .score-widget::after {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .score-widget-value {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

body.dark-mode pre {
    background: #14141a;
    color: #a5b4fc;
    border: 1px solid #2c2c3a;
    padding: 1rem;
    border-radius: 4px;
}

body.dark-mode footer {
    color: #71717a;
}

body.dark-mode footer small {
    color: #63636e;
}

body.dark-mode img.reference-image {
    border: 1px solid #434358;
}

body.dark-mode a[style*="color: #666"],
body.dark-mode a[style*="color:#666"] {
    color: #9ca3af !important;
}
