* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

a {
    color: #0f4c81;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-shell {
    min-height: 100vh;
    padding: 30px 16px;
}

.form-wrapper {
    max-width: 980px;
    margin: 0 auto;
}

.brand-bar {
    margin-bottom: 20px;
}

.brand-bar h1,
.page-header h1,
.login-box h1 {
    margin: 0 0 8px;
}

.brand-bar p,
.page-header p,
.login-box p,
.sidebar-user {
    margin: 0;
    color: #6b7280;
}

.card,
.login-box,
.stat-box {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 22px;
}

.feedback-form,
.stack-form {
    display: grid;
    gap: 18px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    border: 1px solid #d7dde7;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
}

textarea {
    resize: vertical;
}

.question-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
}

.question-number {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #0f4c81;
    margin-bottom: 10px;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.rating-box {
    position: relative;
    border: 1px solid #d7dde7;
    border-radius: 22px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.rating-box input {
    position: absolute;
    opacity: 0;
}

.rating-visual {
    position: relative;
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.face-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.24s ease, opacity 0.24s ease, filter 0.24s ease;
}

.face-default {
    opacity: 1;
}

.face-hover {
    opacity: 0;
    transform: scale(0.88) translateY(6px);
}

.rating-box:hover,
.rating-box:has(input:checked) {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.rating-box:hover .face-default,
.rating-box:has(input:checked) .face-default {
    opacity: 0;
    transform: scale(0.88) translateY(-6px);
}

.rating-box:hover .face-hover,
.rating-box:has(input:checked) .face-hover {
    opacity: 1;
    transform: scale(1.08) translateY(-2px);
}

.rating-box:hover .rating-visual,
.rating-box:has(input:checked) .rating-visual {
    animation: smile-bounce 0.45s ease;
}

.rate-1 {
    background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
}
.rate-1:hover,
.rate-1:has(input:checked) {
    border-color: #ff1d12;
    box-shadow: 0 16px 30px rgba(255, 29, 18, 0.18);
    background: linear-gradient(180deg, #ffe4e2 0%, #ffffff 100%);
}

.rate-2 {
    background: linear-gradient(180deg, #fff8ef 0%, #ffffff 100%);
}
.rate-2:hover,
.rate-2:has(input:checked) {
    border-color: #ff8c1a;
    box-shadow: 0 16px 30px rgba(255, 140, 26, 0.18);
    background: linear-gradient(180deg, #ffe8cc 0%, #ffffff 100%);
}

.rate-3 {
    background: linear-gradient(180deg, #fffdf1 0%, #ffffff 100%);
}
.rate-3:hover,
.rate-3:has(input:checked) {
    border-color: #f3c316;
    box-shadow: 0 16px 30px rgba(243, 195, 22, 0.18);
    background: linear-gradient(180deg, #fff3bf 0%, #ffffff 100%);
}

.rate-4 {
    background: linear-gradient(180deg, #f7fceb 0%, #ffffff 100%);
}
.rate-4:hover,
.rate-4:has(input:checked) {
    border-color: #96c93d;
    box-shadow: 0 16px 30px rgba(150, 201, 61, 0.18);
    background: linear-gradient(180deg, #e5f6c7 0%, #ffffff 100%);
}

.rate-5 {
    background: linear-gradient(180deg, #f2fbf2 0%, #ffffff 100%);
}
.rate-5:hover,
.rate-5:has(input:checked) {
    border-color: #4db748;
    box-shadow: 0 16px 30px rgba(77, 183, 72, 0.18);
    background: linear-gradient(180deg, #d9f7d8 0%, #ffffff 100%);
}

@keyframes smile-bounce {
    0% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-6px) scale(1.08); }
    70% { transform: translateY(2px) scale(0.98); }
    100% { transform: translateY(0) scale(1); }
}

.rating-title {
    display: none;
}

.comment-group {
    margin-top: 8px;
}

.submit-row,
.action-row,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.submit-row {
    justify-content: center;
    margin-top: 28px;
    margin-bottom: 10px;
}

.btn-primary,
.btn-secondary,
.link-button {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.submit-row .btn-primary {
    min-width: 280px;
    min-height: 60px;
    padding: 16px 28px;
    font-size: 18px;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 76, 129, 0.22);
}

.btn-primary {
    background: #0f4c81;
    color: #fff;
}

.btn-secondary {
    background: #eef3f8;
    color: #1f2937;
}

.full-width {
    width: 100%;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.alert.success {
    background: #e8f7ec;
    color: #19663b;
}

.alert.error {
    background: #fdecec;
    color: #9b1c1c;
}

.admin-login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #111827;
    color: #fff;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    color: #d9e1ea;
    padding: 12px 14px;
    border-radius: 12px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.dashboard-main {
    padding: 28px;
    display: grid;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-box span {
    display: block;
    color: #6b7280;
    margin-bottom: 10px;
}

.stat-box strong {
    font-size: 34px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

table th {
    color: #6b7280;
    font-size: 13px;
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    background: #e8f7ec;
    color: #19663b;
}

.status-inactive {
    background: #f4f4f5;
    color: #52525b;
}

.inline-form {
    display: inline;
}

.link-button {
    background: transparent;
    padding: 0;
    font: inherit;
    color: #0f4c81;
}

.danger-link {
    color: #b42318;
}

.checkbox-row {
    display: flex;
    align-items: center;
}

.align-end {
    align-self: end;
    padding-bottom: 8px;
}

.response-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.response-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #fafafa;
}

@media (max-width: 980px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 14px;
    }

    .stats-grid,
    .two-cols,
    .rating-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-main {
        padding: 18px;
    }
}

.question-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.question-chart-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    background: #fbfcfe;
}

.chart-header-row,
.chart-meta-row,
.legend-row,
.legend-label-wrap,
.legend-values {
    display: flex;
    align-items: center;
}

.chart-header-row,
.chart-meta-row,
.legend-row {
    justify-content: space-between;
    gap: 12px;
}

.chart-header-row {
    margin-bottom: 10px;
}

.chart-header-row h3 {
    margin: 0;
    font-size: 18px;
}

.chart-meta-row {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.pie-chart-block {
    display: grid;
    place-items: center;
    margin: 8px 0 18px;
}

.pie-chart {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.08);
}

.pie-hole {
    position: absolute;
    inset: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.pie-hole strong {
    font-size: 26px;
    line-height: 1;
}

.pie-hole span {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.chart-legend {
    display: grid;
    gap: 10px;
}

.legend-row {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
    flex: 0 0 auto;
}

.legend-label {
    font-weight: 600;
}

.legend-values {
    gap: 14px;
    color: #6b7280;
}

.legend-values strong {
    color: #111827;
}

.legend-empty {
    justify-content: center;
    color: #6b7280;
}


code {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 8px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

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

.screenshot-style-card {
    position: relative;
    background: #efefef;
    border: 1px solid #d8d8d8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    min-height: 500px;
    overflow: hidden;
}

.screenshot-chart-title {
    text-align: center;
    font-size: 14px;
    color: #222;
    margin-bottom: 8px;
}

.chart-actions-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: #d1d1d1;
}

.screenshot-chart-area {
    position: relative;
    height: 390px;
}

.pie-3d-wrap {
    position: absolute;
    left: 50%;
    top: 36px;
    width: 370px;
    height: 300px;
    transform: translateX(-50%);
}

.pie-3d-base,
.pie-3d-top {
    position: absolute;
    left: 0;
    width: 370px;
    height: 300px;
    border-radius: 50%;
}

.pie-3d-base {
    top: 20px;
    filter: brightness(0.82);
}

.pie-3d-top {
    top: 0;
    box-shadow: 0 1px 0 rgba(255,255,255,0.45) inset;
}

.chart-callout {
    position: absolute;
    z-index: 3;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}

.chart-callout-left {
    transform: translate(-100%, -50%);
    text-align: right;
}

.chart-callout-right {
    transform: translate(0, -50%);
    text-align: left;
}

.callout-line {
    position: absolute;
    top: 50%;
    height: 1px;
    background: #b5b5b5;
    transform-origin: 0 50%;
}

.chart-callout-right .callout-line {
    left: -8px;
}

.chart-callout-left .callout-line {
    right: -8px;
    transform-origin: 100% 50%;
}

.callout-text {
    position: relative;
    z-index: 2;
    background: transparent;
}

.chart-callout-right .callout-text {
    padding-left: 60px;
}

.chart-callout-left .callout-text {
    padding-right: 60px;
}

.screenshot-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 0 10px 8px;
    font-size: 12px;
}

.screenshot-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-square {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: inline-block;
}

.legend-empty-line {
    color: #6b7280;
}

@media (max-width: 1200px) {
    .question-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .screenshot-style-card {
        min-height: auto;
        padding: 16px;
    }

    .screenshot-chart-area {
        height: 330px;
    }

    .pie-3d-wrap,
    .pie-3d-base,
    .pie-3d-top {
        width: 280px;
        height: 220px;
    }

    .pie-3d-wrap {
        top: 58px;
    }

    .chart-callout {
        font-size: 11px;
        white-space: normal;
        max-width: 120px;
    }

    .chart-callout-right .callout-text {
        padding-left: 42px;
    }

    .chart-callout-left .callout-text {
        padding-right: 42px;
    }
}

/* Interactive chart upgrade */
.interactive-chart-card {
    transform-style: preserve-3d;
    transition: transform 180ms ease, box-shadow 180ms ease;
    will-change: transform;
}

.interactive-chart-card:hover {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.screenshot-chart-area {
    position: relative;
    height: 390px;
    perspective: 1200px;
}

.interactive-pie-wrap {
    position: absolute;
    left: 50%;
    top: 26px;
    width: 480px;
    height: 300px;
    transform: translateX(-50%);
}

.interactive-pie-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.pie-shadow-ellipse {
    fill: rgba(0, 0, 0, 0.10);
    filter: blur(4px);
}

.pie-slice-base,
.pie-slice-top {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
    cursor: pointer;
}

.pie-slice-top:hover {
    filter: brightness(1.03);
}

.chart-tooltip {
    position: absolute;
    z-index: 12;
    padding: 8px 14px;
    border-radius: 6px;
    background: #f39c12;
    color: #222;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 8px 18px rgba(0,0,0,0.16);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 120ms ease, transform 120ms ease;
    white-space: nowrap;
}

.chart-tooltip::after {
    content: '';
    position: absolute;
    left: 18px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: #f39c12;
    border-right: 1px solid rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.7);
    transform: rotate(45deg);
}

.chart-tooltip.visible {
    opacity: 1;
    transform: translateY(-14px);
}

.empty-pie-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 720px) {
    .interactive-pie-wrap {
        width: 320px;
        height: 230px;
        top: 58px;
    }

    .chart-tooltip {
        font-size: 11px;
        padding: 7px 10px;
    }
}

.brand-card {
    padding: 26px;
}

.brand-card-inner,
.brand-identity,
.login-branding,
.sidebar-branding,
.settings-preview,
.thank-you-meta,
.thank-you-actions {
    display: flex;
    gap: 16px;
}

.brand-card-inner,
.login-branding,
.sidebar-branding,
.settings-preview {
    align-items: center;
}

.company-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.company-logo.large {
    width: 86px;
    height: 86px;
}

.preview-logo,
.thank-you-logo {
    width: 96px;
    height: 96px;
}

.sidebar-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
}

.sidebar-company {
    margin: 4px 0;
    color: #9ca3af;
    font-size: 13px;
}

.helper-text {
    display: inline-block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.settings-preview {
    justify-content: flex-start;
}

.logo-placeholder {
    width: 96px;
    height: 96px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #6b7280;
    padding: 10px;
}

.thank-you-shell {
    display: grid;
    place-items: center;
}

.thank-you-card {
    max-width: 680px;
    margin: 40px auto;
    text-align: center;
}

.thank-you-card h1 {
    margin-bottom: 10px;
}

.thank-you-card p {
    color: #4b5563;
}

.thank-you-meta {
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    gap: 8px;
}

.thank-you-meta p {
    margin: 0;
}

.thank-you-actions {
    justify-content: center;
    margin-top: 24px;
}

input[type="file"] {
    width: 100%;
    border: 1px solid #d7dde7;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
}

@media (max-width: 980px) {
    .brand-card-inner,
    .brand-identity,
    .login-branding,
    .sidebar-branding,
    .settings-preview {
        flex-direction: column;
        align-items: flex-start;
    }

    .thank-you-card {
        margin: 10px auto;
    }
}


/* Responsive and modern UI upgrade */
:root {
    --bg-soft: #f4f7fb;
    --brand: #0f4c81;
    --brand-2: #2563eb;
    --text-main: #111827;
    --text-soft: #6b7280;
    --line: #e5e7eb;
}

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

.card,
.login-box,
.stat-box,
.question-chart-card,
.response-item,
.question-card,
.screenshot-style-card {
    width: 100%;
}

.brand-card-inner,
.brand-identity,
.login-branding,
.sidebar-branding,
.settings-preview,
.thank-you-meta,
.thank-you-actions {
    flex-wrap: wrap;
}

.submit-row,
.action-row,
.section-head,
.chart-header-row,
.chart-meta-row,
.legend-row {
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.link-button {
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.10);
    text-decoration: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
input[type="file"] {
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    display: block;
    font-weight: 600;
}

.table-wrap {
    border-radius: 16px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .site-shell {
        padding: 18px 12px;
    }

    .form-wrapper {
        max-width: 100%;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 40;
        min-height: auto;
        padding: 16px 14px;
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
    }

    .sidebar-branding {
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 10px;
    }

    .dashboard-main {
        padding: 16px 12px 24px;
    }

    .stats-grid,
    .tracking-stats-grid,
    .question-stats-grid,
    .two-cols {
        grid-template-columns: 1fr;
    }

    .brand-card,
    .card,
    .login-box,
    .stat-box,
    .question-chart-card,
    .screenshot-style-card {
        border-radius: 16px;
        padding: 18px;
    }

    .submit-row .btn-primary,
    .action-row .btn-primary,
    .action-row .btn-secondary,
    .submit-row .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

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

    .rating-box {
        min-height: 110px;
        padding: 16px 10px;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
    }

    .company-logo.large,
    .preview-logo,
    .thank-you-logo {
        width: 78px;
        height: 78px;
    }

    .question-card h3,
    .page-header h1,
    .brand-bar h1,
    .thank-you-card h1 {
        font-size: 22px;
        line-height: 1.25;
    }

    table {
        min-width: 640px;
    }

    table th,
    table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .interactive-pie-wrap {
        width: min(100%, 320px);
    }
}

@media (max-width: 560px) {
    .site-shell {
        padding: 14px 10px;
    }

    .brand-card-inner,
    .brand-identity,
    .login-branding,
    .thank-you-actions,
    .settings-preview {
        flex-direction: column;
        align-items: flex-start;
    }

    .thank-you-card {
        margin: 18px auto;
    }

    .thank-you-actions {
        align-items: stretch;
    }

    .thank-you-actions .btn-primary,
    .thank-you-actions .btn-secondary,
    .thank-you-actions a {
        width: 100%;
    }

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

    .emoji {
        font-size: 40px;
    }

    .submit-row {
        position: sticky;
        bottom: 10px;
        z-index: 20;
    }

    .submit-row .btn-primary {
        width: min(100%, 360px);
        min-width: 0;
        min-height: 58px;
        font-size: 17px;
    }

    .chart-callout {
        display: none;
    }

    .screenshot-chart-area {
        height: 260px;
    }

    .interactive-pie-wrap {
        top: 18px;
        height: 190px;
    }

    .screenshot-legend {
        justify-content: flex-start;
        gap: 12px;
    }
}

/* Modern interactive login */
.admin-login-body {
    position: relative;
    background:
        radial-gradient(circle at 20% 20%, rgba(37,99,235,0.18), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(14,165,233,0.14), transparent 26%),
        linear-gradient(135deg, #081223 0%, #0f172a 45%, #102847 100%);
}

.admin-login-body::before,
.admin-login-body::after {
    content: '';
    position: fixed;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.55;
    pointer-events: none;
}

.admin-login-body::before {
    width: 300px;
    height: 300px;
    background: rgba(59, 130, 246, 0.22);
    top: -80px;
    left: -70px;
}

.admin-login-body::after {
    width: 340px;
    height: 340px;
    background: rgba(14, 165, 233, 0.18);
    bottom: -120px;
    right: -90px;
}

.login-screen {
    width: 100%;
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 460px);
    gap: 28px;
    align-items: stretch;
}

.login-showcase,
.login-box.modern-login {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.login-showcase {
    background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 28px;
    padding: 34px;
    color: #f8fafc;
    box-shadow: 0 20px 60px rgba(0,0,0,0.24);
    display: grid;
    align-content: space-between;
    min-height: 620px;
}

.login-showcase::before {
    content: '';
    position: absolute;
    inset: auto -40px -90px auto;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(96,165,250,0.34), transparent 64%);
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.login-showcase h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    margin: 18px 0 14px;
}

.login-showcase p {
    max-width: 560px;
    color: rgba(255,255,255,0.82);
    font-size: 16px;
    line-height: 1.7;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.login-feature {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 16px;
}

.login-feature strong {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

.login-feature span {
    color: rgba(255,255,255,0.72);
    font-size: 13px;
    line-height: 1.5;
}

.login-box.modern-login {
    max-width: 100%;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.40);
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 18px 55px rgba(2, 8, 23, 0.28);
}

.login-branding {
    margin-bottom: 18px;
}

.login-copy {
    margin-bottom: 18px;
}

.login-copy h2 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
    color: #0f172a;
}

.login-copy p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.form-field {
    display: grid;
    gap: 8px;
}

.password-row {
    position: relative;
}

.password-row input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #64748b;
    padding: 8px;
}

.login-submit {
    min-height: 50px;
    background: linear-gradient(135deg, #0f4c81 0%, #2563eb 100%);
    box-shadow: 0 10px 24px rgba(37,99,235,0.22);
}

.login-footer-note {
    margin-top: 16px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
}

.login-orb {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(1px);
    opacity: 0.55;
}

.login-orb.one {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(56,189,248,0.48), rgba(56,189,248,0.02));
    top: 18%;
    right: 12%;
}

.login-orb.two {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(255,255,255,0.35), rgba(255,255,255,0.02));
    bottom: 14%;
    left: 16%;
}

@media (max-width: 1080px) {
    .login-screen {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .login-showcase {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .admin-login-body {
        padding: 12px;
    }

    .login-screen {
        gap: 16px;
    }

    .login-showcase,
    .login-box.modern-login {
        border-radius: 22px;
        padding: 22px 18px;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
    }

    .login-copy h2 {
        font-size: 24px;
    }

    .login-showcase h1 {
        font-size: 32px;
    }
}


/* Patch: keep chart labels inside the chart area */
.screenshot-chart-area {
    overflow: hidden;
}

.chart-callout {
    max-width: 160px;
    white-space: normal;
    line-height: 1.25;
}

.callout-text {
    display: inline-block;
    background: rgba(247, 247, 247, 0.92);
    padding-top: 2px;
    padding-bottom: 2px;
}

.chart-callout-right .callout-text {
    padding-left: 44px;
}

.chart-callout-left .callout-text {
    padding-right: 44px;
}

.callout-line {
    opacity: 0.9;
}

@media (max-width: 720px) {
    .chart-callout {
        max-width: 110px;
        font-size: 10px;
    }

    .chart-callout-right .callout-text {
        padding-left: 32px;
    }

    .chart-callout-left .callout-text {
        padding-right: 32px;
    }
}

/* Patch: simpler login page with bigger logo */
.simple-login-screen {
    max-width: 560px;
    grid-template-columns: 1fr;
    justify-content: center;
}

.minimalist-login {
    max-width: 100%;
    padding: 34px 30px;
}

.login-branding-centered {
    justify-content: center;
    margin-bottom: 24px;
}

.login-logo-xl {
    width: 160px;
    height: 160px;
    padding: 14px;
    border-radius: 24px;
}

.minimalist-login .login-orb.one {
    top: -10px;
    right: -10px;
}

.minimalist-login .login-orb.two {
    bottom: -8px;
    left: -8px;
}

@media (max-width: 640px) {
    .minimalist-login {
        padding: 24px 18px;
    }

    .login-logo-xl {
        width: 120px;
        height: 120px;
    }
}

:root {
    --brand-primary: #0f4c81;
    --brand-primary-dark: #0b3c66;
    --brand-accent: #22c55e;
    --brand-soft: #eef5ff;
    --brand-text: #172033;
    --brand-muted: #64748b;
    --brand-surface: #ffffff;
    --brand-bg: #f4f7fb;
}

body {
    background: var(--brand-bg);
    color: var(--brand-text);
}

a { color: var(--brand-primary); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
}

.btn-secondary {
    background: var(--brand-soft);
    color: var(--brand-primary-dark);
}

.brand-card,
.card,
.login-box,
.stat-box {
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.question-number,
.status-active,
.keyword-chip,
.sentiment-progress span,
.toggle-password,
.sidebar nav a.active,
.sidebar nav a:hover {
    background-color: var(--brand-soft);
}

.sidebar {
    background: linear-gradient(180deg, #111827 0%, #182132 100%);
}

.sidebar-company,
.sidebar-user,
.muted-note,
.helper-text,
.empty-note,
.question-chart-subtitle,
.priority-comment-meta,
.export-card p,
.kpi-box small {
    color: var(--brand-muted);
}

.status-active {
    color: var(--brand-primary-dark);
}

.color-input-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
}

.color-input-row input[type="color"] {
    width: 72px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #d7dde7;
    padding: 4px;
    background: #fff;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-grid-wide {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-box {
    display: grid;
    gap: 8px;
}

.kpi-box strong {
    font-size: 32px;
    line-height: 1;
}

.insight-grid {
    display: grid;
    gap: 20px;
}

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

.compact-head {
    align-items: flex-start;
}

.trend-chart-wrap {
    display: grid;
    gap: 14px;
}

.trend-svg {
    width: 100%;
    height: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 18px;
}

.trend-axis,
.trend-grid-line {
    stroke: #d7dde7;
    stroke-width: 1;
}

.trend-grid-line {
    stroke-dasharray: 4 6;
}

.trend-line {
    fill: none;
    stroke: var(--brand-primary);
    stroke-width: 4;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.trend-point {
    fill: var(--brand-accent);
    stroke: #fff;
    stroke-width: 3;
}

.trend-label-row {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 8px;
    font-size: 12px;
    color: var(--brand-muted);
}

.insight-list,
.sentiment-bars,
.priority-comments-list {
    display: grid;
    gap: 14px;
}

.insight-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
}

.insight-label {
    color: var(--brand-muted);
    max-width: 45%;
}

.sentiment-bar-row {
    display: grid;
    gap: 8px;
}

.sentiment-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sentiment-progress {
    height: 12px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
}

.sentiment-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-primary);
}

.sentiment-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.sentiment-positive { background: #e8f7ec; color: #19663b; }
.sentiment-neutral { background: #eef3f8; color: #475569; }
.sentiment-negative { background: #fdecec; color: #9b1c1c; }

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--brand-primary-dark);
}

.priority-comment-item,
.export-card {
    border: 1px solid #e5ebf3;
    border-radius: 18px;
    padding: 16px;
    background: #fff;
}

.priority-comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.export-card {
    display: grid;
    gap: 14px;
}

.branding-preview {
    display: grid;
    gap: 18px;
}

.branding-preview-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border-radius: 20px;
    background: #fbfdff;
    border: 1px solid #e6edf7;
}

.branding-preview-footer {
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
}

.preview-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.compact-chart-area {
    min-height: 360px;
}

.question-chart-subtitle {
    margin-bottom: 6px;
    font-size: 13px;
}

.chart-callout {
    max-width: 130px;
}

.callout-text {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 4px 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.interactive-pie-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pie-slice-top {
    transition: transform .18s ease, filter .18s ease;
    cursor: pointer;
}

.pie-shadow-ellipse {
    fill: rgba(15, 23, 42, 0.12);
}

.chart-tooltip {
    position: absolute;
    z-index: 5;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    max-width: 160px;
}

.chart-tooltip.visible { opacity: 1; }

.screenshot-chart-area { position: relative; overflow: hidden; }

.screenshot-style-card {
    background: linear-gradient(180deg, #fafcff 0%, #f3f7fc 100%);
}

.compact-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.legend-square {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

.screenshot-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.thank-you-card h1,
.brand-card h1,
.page-header h1 {
    color: var(--brand-text);
}

.password-row {
    display: grid;
    grid-template-columns: 1fr 52px;
    gap: 10px;
}

.toggle-password {
    border: 0;
    border-radius: 12px;
}

.login-box.modern-login {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(16px);
}

.admin-login-body {
    background: radial-gradient(circle at top left, color-mix(in srgb, var(--brand-primary) 18%, white) 0%, transparent 32%),
                radial-gradient(circle at bottom right, color-mix(in srgb, var(--brand-accent) 18%, white) 0%, transparent 26%),
                linear-gradient(135deg, #f5f8fd 0%, #edf3fb 100%);
}

@media (max-width: 1100px) {
    .stats-grid-wide,
    .export-grid,
    .two-up-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .trend-label-row {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .trend-label-row span:nth-child(n+8) {
        display: none;
    }

    .compact-legend,
    .stats-grid-wide,
    .two-up-grid,
    .export-grid,
    .grid.two-cols {
        grid-template-columns: 1fr;
    }

    .branding-preview-header,
    .priority-comment-top,
    .header-actions,
    .insight-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .insight-label {
        max-width: none;
    }
}


@media (max-width: 640px) {
    .rating-grid {
        gap: 8px;
    }

    .rating-box {
        min-height: 88px;
        padding: 10px 4px;
        border-radius: 14px;
    }

    .face-icon {
        width: 52px;
        height: 52px;
    }
}

/* Rating UX overrides */
@media (max-width: 720px) {
    .rating-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rating-box {
        min-height: 108px;
    }

    .rating-visual {
        width: 74px;
        height: 74px;
    }
}

@media (max-width: 480px) {
    .rating-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rating-box {
        min-height: 100px;
        border-radius: 18px;
    }

    .rating-visual {
        width: 68px;
        height: 68px;
    }
}
