:root {
    color-scheme: dark;
    --page: #07111f;
    --page-deep: #040a13;
    --surface: #0e1c2d;
    --surface-soft: #122338;
    --field: #091524;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.17);
    --text: #f5f8fb;
    --muted: #8fa3b7;
    --muted-strong: #bfd0df;
    --cyan: #4ce2e6;
    --cyan-soft: rgba(76, 226, 230, 0.13);
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, 0.14);
    --green: #63e6ab;
    --danger: #ff8ea0;
    --radius-large: 20px;
    --radius-medium: 13px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page-deep);
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% -12rem, rgba(68, 122, 166, 0.19), transparent 36rem),
        linear-gradient(180deg, var(--page), var(--page-deep));
    color: var(--text);
    font-family: "Inter", sans-serif;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button:not(:disabled),
select:not(:disabled) {
    cursor: pointer;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 13, 23, 0.84);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: min(1080px, calc(100% - 32px));
    min-height: 58px;
    margin: 0 auto;
}

.back-link,
.brand,
.share-button {
    font-size: 0.78rem;
    font-weight: 700;
}

.back-link {
    width: max-content;
    color: var(--muted);
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: "Outfit", sans-serif;
    font-size: 0.92rem;
}

.brand-mark {
    position: relative;
    width: 24px;
    height: 18px;
}

.brand-mark i {
    position: absolute;
    border: 2px solid;
    border-radius: 3px;
}

.brand-mark i:first-child {
    inset: 0 6px 4px 0;
    border-color: var(--cyan);
}

.brand-mark i:last-child {
    inset: 5px 0 0 8px;
    border-color: var(--violet);
}

.share-button {
    justify-self: end;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted-strong);
}

.share-button:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.page-shell {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 28px;
}

.intro {
    text-align: center;
}

.intro h1 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: clamp(2.25rem, 5vw, 3.7rem);
    letter-spacing: -0.045em;
    line-height: 1;
}

.intro p {
    margin: 9px 0 0;
    color: var(--muted-strong);
    font-size: 0.92rem;
}

.category-tabs {
    display: grid;
    grid-template-columns: 1.45fr 1fr 1fr;
    width: min(450px, 100%);
    margin: 25px auto 18px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(4, 12, 21, 0.72);
}

.category-tabs button,
.unit-toggle button,
.view-toggle button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}

.category-tabs button {
    min-height: 42px;
    border-radius: 9px;
    font-size: 0.8rem;
}

.category-tabs button:hover,
.unit-toggle button:hover,
.view-toggle button:hover {
    color: var(--text);
}

.category-tabs button.is-active {
    background: var(--surface-soft);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    color: var(--text);
}

.picker-panel,
.visual-panel,
.measurements {
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    background: rgba(14, 28, 45, 0.88);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.picker-panel {
    padding: 18px;
}

.panel-topline,
.visual-header,
.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-topline h2,
.visual-header h2 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: 1.12rem;
}

.unit-toggle,
.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(3, 10, 18, 0.52);
}

.unit-toggle button {
    min-width: 36px;
    min-height: 30px;
    border-radius: 6px;
    font-size: 0.68rem;
}

.view-toggle button {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 6px;
    font-size: 0.69rem;
}

.unit-toggle button.is-active,
.view-toggle button.is-active {
    background: var(--surface-soft);
    color: var(--text);
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    margin-top: 14px;
}

.screen-picker {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.022);
    box-shadow: inset 3px 0 0 var(--screen-accent);
}

.picker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-family: "Outfit", sans-serif;
    font-size: 0.82rem;
}

.screen-badge,
.table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-family: "Inter", sans-serif;
    font-weight: 800;
}

.screen-badge {
    width: 23px;
    height: 23px;
    background: var(--screen-fill);
    color: var(--screen-accent);
    font-size: 0.61rem;
}

.table-badge {
    width: 21px;
    height: 21px;
    background: var(--screen-fill);
    color: var(--screen-accent);
    font-size: 0.6rem;
}

.remove-screen-button {
    min-height: 28px;
    margin-left: auto;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 0.57rem;
    font-weight: 800;
}

.remove-screen-button:hover {
    border-color: rgba(255, 142, 160, 0.38);
    color: #ffc3ce;
}

label > span:first-child {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: 0;
    background: var(--field);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
}

input {
    padding: 0 10px;
}

input:hover {
    border-color: var(--line-strong);
}

input:focus {
    border-color: rgba(76, 226, 230, 0.6);
    box-shadow: 0 0 0 3px rgba(76, 226, 230, 0.09);
}

input[aria-invalid="true"] {
    border-color: var(--danger);
}

.custom-fields[hidden] {
    display: none;
}

.device-choice {
    display: grid;
    width: 100%;
    min-height: 108px;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.device-choice:hover {
    border-color: var(--line-strong);
    background: #0b192a;
    transform: translateY(-1px);
}

.choice-art {
    position: relative;
    display: flex;
    width: 112px;
    height: 82px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background:
        radial-gradient(circle at 50% 15%, rgba(76, 226, 230, 0.12), transparent 60%),
        rgba(255, 255, 255, 0.035);
}

.generic-display {
    display: block;
    width: 68px;
    aspect-ratio: var(--display-ratio, 16 / 9);
    border: 2px solid var(--muted-strong);
    border-radius: 3px;
    box-shadow: 0 0 0 4px rgba(143, 163, 183, 0.08);
    opacity: 0.8;
}

.mobile-product-image {
    display: block;
    width: auto;
    height: 130px;
    max-width: calc(100% - 14px);
    max-height: calc(100% - 12px);
    flex: none;
    object-fit: contain;
    filter: drop-shadow(0 9px 12px rgba(2, 8, 18, 0.2));
    user-select: none;
}

.mobile-product-image--choice {
    height: 74px;
    max-width: 102px;
    max-height: 74px;
}

.mobile-product-image--tablet {
    height: auto;
}

.mobile-product-image--choice.mobile-product-image--tablet {
    height: auto;
}

.mobile-product-image--watch,
.mobile-product-image--choice.mobile-product-image--watch {
    width: auto;
    height: auto;
}

.choice-art[data-category="phone"] {
    background: #f5f7f9;
}

.choice-art[data-category="phone"] .generic-display {
    width: 33px;
    aspect-ratio: 9 / 19.5;
    border-radius: 7px;
}

.choice-art[data-category="tv"] .generic-display::after {
    display: block;
    width: 24px;
    height: 2px;
    margin: 6px auto 0;
    border-radius: 2px;
    background: var(--muted-strong);
    content: "";
}

.choice-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.choice-brand {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.choice-copy strong {
    overflow: hidden;
    font-family: "Outfit", sans-serif;
    font-size: 0.92rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.choice-copy > span:last-child {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 0.64rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.choice-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 800;
}

.choice-action i {
    font-size: 1.25rem;
    font-style: normal;
    line-height: 1;
}

.custom-fields {
    display: grid;
    grid-template-columns: minmax(95px, 1.15fr) minmax(62px, 0.75fr) auto minmax(62px, 0.75fr);
    gap: 7px;
    align-items: end;
    margin-top: 10px;
}

.input-suffix {
    position: relative;
    display: block;
}

.input-suffix input {
    padding-right: 32px;
}

.input-suffix i {
    position: absolute;
    top: 50%;
    right: 10px;
    color: var(--muted);
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 800;
    transform: translateY(-50%);
    pointer-events: none;
}

.ratio-colon {
    display: flex;
    min-height: 40px;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.field-error {
    min-height: 0;
    margin: 5px 0 0;
    color: var(--danger);
    font-size: 0.61rem;
}

.field-error:empty {
    display: none;
}

.screen-spec {
    margin: 9px 0 0;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 0.67rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-screen-button {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 11px;
    background: transparent;
    color: var(--muted-strong);
    font-size: 0.7rem;
    font-weight: 800;
}

.add-screen-button > span {
    color: var(--cyan);
    font-size: 1rem;
}

.add-screen-button small {
    margin-left: 2px;
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 700;
}

.add-screen-button:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.add-screen-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.visual-panel {
    margin-top: 14px;
    padding: 18px;
}

.section-label {
    display: block;
    margin-bottom: 2px;
    color: var(--cyan);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.comparison-canvas {
    position: relative;
    height: 430px;
    margin-top: 13px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        radial-gradient(circle at 50% 46%, rgba(53, 104, 145, 0.14), transparent 60%),
        rgba(3, 10, 18, 0.58);
    background-size: 26px 26px, 26px 26px, auto, auto;
}

body[data-category="phone"] .comparison-canvas {
    height: 470px;
}

.comparison-canvas::after {
    position: absolute;
    right: 24px;
    bottom: 23px;
    left: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13) 12%, rgba(255, 255, 255, 0.13) 88%, transparent);
    content: "";
}

.comparison-plane {
    position: absolute;
    inset: 0;
}

.screen-shape {
    position: absolute;
    min-width: 1px;
    min-height: 1px;
    overflow: hidden;
    border-width: 3px;
    border-style: solid;
    border-radius: 5px;
    transition:
        width 240ms cubic-bezier(0.22, 1, 0.36, 1),
        height 240ms cubic-bezier(0.22, 1, 0.36, 1),
        left 240ms cubic-bezier(0.22, 1, 0.36, 1),
        bottom 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-category="phone"] .screen-shape {
    border-radius: 12px;
}

.screen-shape {
    border-color: var(--screen-accent);
    background: var(--screen-fill);
    box-shadow: 0 14px 45px var(--screen-fill);
}

.screen-shape:nth-child(even) {
    border-style: dashed;
}

body[data-category="phone"] .screen-shape[data-shape="round"] {
    border-radius: 50%;
}

body[data-category="phone"] .screen-shape[data-shape="rounded"] {
    border-radius: 28%;
}

.shape-label {
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 8px;
    display: inline-flex;
    width: 23px;
    height: 23px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(3, 10, 18, 0.75);
    color: var(--screen-accent);
    font-size: 0.62rem;
    font-weight: 800;
}

.screen-shape:nth-child(2) .shape-label {
    right: 8px;
    left: auto;
}

.screen-shape:nth-child(3) .shape-label {
    top: auto;
    bottom: 7px;
}

.screen-shape:nth-child(4) .shape-label {
    top: auto;
    right: 8px;
    bottom: 7px;
    left: auto;
}

.screen-shape:nth-child(5) .shape-label {
    left: 50%;
    transform: translateX(-50%);
}

.screen-shape:nth-child(6) .shape-label {
    top: auto;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
}

.diagonal-guide {
    position: absolute;
    bottom: 0;
    left: 0;
    display: block;
    height: 1px;
    background: currentColor;
    opacity: 0.22;
    transform-origin: left center;
}

.screen-shape .diagonal-guide {
    color: var(--screen-accent);
}

.screen-shape[data-shape="round"] .diagonal-guide {
    display: none;
}

.result-row {
    padding: 16px 2px 3px;
}

.result-copy {
    min-width: 0;
}

.result-copy h2 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.7rem);
}

.result-copy p {
    margin: 4px 0 0;
    color: var(--muted-strong);
    font-size: 0.76rem;
}

.area-chip {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid rgba(99, 230, 171, 0.22);
    border-radius: 10px;
    background: rgba(99, 230, 171, 0.08);
    color: var(--green);
    font-family: "Outfit", sans-serif;
    font-size: 1rem;
}

.scale-note {
    margin: 8px 2px 0;
    color: var(--muted);
    font-size: 0.61rem;
}

.measurements {
    margin-top: 14px;
    overflow: hidden;
}

.measurements summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
}

.measurements summary::-webkit-details-marker {
    display: none;
}

.measurements summary::after {
    color: var(--muted);
    content: "+";
    font-size: 1.2rem;
}

.measurements[open] summary::after {
    content: "−";
}

.measurements summary span {
    font-family: "Outfit", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.measurements summary small {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.63rem;
}

.table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--line);
}

table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    text-align: right;
}

thead th {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
}

thead th:not(:first-child) {
    min-width: 126px;
}

thead th small {
    display: block;
    max-width: 118px;
    margin: 5px 0 0 auto;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th:first-child,
tbody th {
    text-align: left;
}

tbody th,
tbody td {
    font-size: 0.7rem;
}

tbody th {
    color: var(--muted);
}

tbody td {
    color: var(--muted-strong);
    font-weight: 700;
}

tbody tr:last-child th,
tbody tr:last-child td {
    border-bottom: 0;
}

.site-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 19px 3px 0;
    color: var(--muted);
    font-size: 0.61rem;
}

.site-footer p {
    max-width: 760px;
    margin: 0;
}

.site-footer a {
    color: var(--muted-strong);
    font-weight: 700;
}

.site-footer > a {
    flex: 0 0 auto;
    text-decoration: none;
}

.model-dialog {
    width: min(900px, calc(100% - 28px));
    max-width: none;
    max-height: min(760px, calc(100vh - 32px));
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    outline: 0;
    background: #0b1726;
    color: var(--text);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62);
}

.model-dialog::backdrop {
    background: rgba(1, 6, 12, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dialog-shell {
    display: flex;
    max-height: min(760px, calc(100vh - 32px));
    flex-direction: column;
}

.dialog-header {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(14, 28, 45, 0.97);
}

.dialog-header h2 {
    margin: 1px 0 0;
    font-family: "Outfit", sans-serif;
    font-size: 1.28rem;
    letter-spacing: -0.02em;
}

.dialog-eyebrow {
    display: block;
    color: var(--cyan);
    font-size: 0.59rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dialog-back,
.dialog-close {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted-strong);
}

.dialog-back[hidden] {
    visibility: hidden;
}

.dialog-back {
    font-size: 1rem;
}

.dialog-close {
    justify-self: end;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
}

.dialog-back:hover,
.dialog-close:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.dialog-search {
    position: relative;
    flex: 0 0 auto;
    padding: 14px 20px 0;
    background: #0b1726;
}

.dialog-search[hidden] {
    display: none;
}

.dialog-search > span {
    position: absolute;
    top: 22px;
    left: 34px;
    z-index: 1;
    color: var(--muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.dialog-search input {
    min-height: 44px;
    padding-left: 38px;
    border-radius: 11px;
    background: #07121f;
}

.dialog-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 20px 22px;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.brand-card {
    display: grid;
    min-height: 108px;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.brand-card:hover {
    border-color: rgba(76, 226, 230, 0.34);
    background: rgba(76, 226, 230, 0.045);
    transform: translateY(-2px);
}

.brand-card.is-selected {
    border-color: rgba(76, 226, 230, 0.48);
    box-shadow: inset 0 0 0 1px rgba(76, 226, 230, 0.13);
}

.brand-logo-well {
    display: flex;
    width: 70px;
    height: 70px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.11), transparent 65%),
        #111f31;
}

.brand-logo-well img {
    width: 38px;
    max-height: 32px;
    object-fit: contain;
}

.brand-card[data-brand="Samsung"] .brand-logo-well img,
.brand-card[data-brand="Sony"] .brand-logo-well img,
.brand-card[data-brand="OPPO"] .brand-logo-well img,
.brand-card[data-brand="HONOR"] .brand-logo-well img {
    width: 52px;
}

.custom-logo {
    color: var(--violet);
    font-family: "Outfit", sans-serif;
    font-size: 1.75rem;
}

.brand-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.brand-card-copy strong {
    font-family: "Outfit", sans-serif;
    font-size: 1rem;
}

.brand-card-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 600;
}

.brand-arrow {
    color: var(--muted);
    font-size: 1.45rem;
}

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

.model-section-title {
    grid-column: 1 / -1;
    margin: 10px 2px 0;
    color: var(--muted-strong);
    font-family: "Outfit", sans-serif;
    font-size: 0.69rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.model-section-title:first-child {
    margin-top: 0;
}

.model-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 248px;
    overflow: hidden;
    flex-direction: column;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.model-card:hover {
    border-color: rgba(76, 226, 230, 0.35);
    background: rgba(76, 226, 230, 0.04);
    transform: translateY(-2px);
}

.model-card.is-selected {
    border-color: rgba(76, 226, 230, 0.58);
    box-shadow: inset 0 0 0 1px rgba(76, 226, 230, 0.15);
}

.model-card-art {
    position: relative;
    display: flex;
    width: 100%;
    height: 142px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 50% 30%, rgba(99, 134, 166, 0.15), transparent 65%),
        #0b1624;
}

body[data-category="phone"] .model-card-art {
    background: #f5f7f9;
}

body[data-category="monitor"] .model-card,
body[data-category="tv"] .model-card {
    min-height: 198px;
}

body[data-category="monitor"] .model-card-art,
body[data-category="tv"] .model-card-art {
    height: 104px;
}

.model-card-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    padding: 12px 13px 13px;
}

.model-card-copy strong {
    margin-top: 3px;
    font-family: "Outfit", sans-serif;
    font-size: 0.86rem;
    line-height: 1.22;
}

.model-kicker,
.model-specs {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-kicker {
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.model-specs {
    margin-top: 5px;
    color: var(--muted-strong);
}

.selected-pill {
    align-self: flex-start;
    margin-top: 8px;
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--cyan-soft);
    color: var(--cyan);
    font-size: 0.54rem;
    font-weight: 800;
}

.picker-display {
    position: relative;
    display: flex;
    width: 68%;
    max-width: 138px;
    aspect-ratio: var(--display-ratio, 16 / 9);
    align-items: center;
    justify-content: center;
    border: 3px solid var(--muted-strong);
    border-radius: 4px;
    color: var(--muted-strong);
    box-shadow: 0 0 0 7px rgba(143, 163, 183, 0.06);
    opacity: 0.8;
}

.picker-display[data-category="monitor"]::after {
    position: absolute;
    top: 100%;
    width: 30%;
    height: 12px;
    border-bottom: 2px solid var(--muted-strong);
    content: "";
}

.picker-display b {
    font-family: "Outfit", sans-serif;
    font-size: 0.84rem;
}

.custom-card-art {
    color: var(--violet);
    font-family: "Outfit", sans-serif;
    font-size: 2.4rem;
}

.dialog-empty {
    margin: -8px 20px 22px;
    padding: 26px;
    border: 1px dashed var(--line);
    border-radius: 13px;
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

.toast {
    position: fixed;
    z-index: 50;
    right: 18px;
    bottom: 18px;
    max-width: calc(100% - 36px);
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(18, 35, 56, 0.98);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.noscript-message {
    position: fixed;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 100;
    padding: 13px;
    border: 1px solid rgba(255, 142, 160, 0.35);
    border-radius: 11px;
    background: #35141c;
    color: #ffd8df;
    text-align: center;
}

:focus-visible {
    outline: 3px solid rgba(76, 226, 230, 0.52);
    outline-offset: 3px;
}

@media (max-width: 760px) {
    .device-choice {
        grid-template-columns: 92px minmax(0, 1fr) auto;
    }

    .choice-art {
        width: 92px;
    }

    .custom-fields {
        grid-template-columns: 1fr 1fr auto 1fr;
    }

    .diagonal-field {
        grid-column: 1 / -1;
    }

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

@media (max-width: 620px) {
    .header-inner,
    .page-shell {
        width: min(100% - 24px, 1080px);
    }

    .back-link span {
        display: none;
    }

    .share-button {
        min-width: 40px;
        padding: 0 10px;
        font-size: 0;
    }

    .share-button span {
        font-size: 0.85rem;
    }

    .page-shell {
        padding-top: 30px;
    }

    .picker-panel,
    .visual-panel {
        padding: 14px;
    }

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

    .comparison-canvas,
    body[data-category="phone"] .comparison-canvas {
        height: 390px;
    }

    .result-row {
        align-items: flex-start;
    }

    .result-copy p {
        max-width: 260px;
    }

    .measurements summary small {
        display: none;
    }

    .site-footer {
        display: block;
        text-align: center;
    }

    .site-footer > a {
        display: inline-block;
        margin-top: 10px;
    }

    .model-dialog {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 17px;
    }

    .dialog-shell {
        max-height: calc(100vh - 16px);
    }

    .dialog-header {
        padding: 14px;
    }

    .dialog-search {
        padding: 12px 14px 0;
    }

    .dialog-search > span {
        top: 20px;
        left: 27px;
    }

    .dialog-body {
        padding: 14px;
    }

    .brand-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .brand-card {
        min-height: 86px;
        grid-template-columns: 56px minmax(0, 1fr) auto;
        padding: 10px;
    }

    .brand-logo-well {
        width: 56px;
        height: 56px;
        border-radius: 11px;
    }
}

@media (max-width: 400px) {
    .device-choice {
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 10px;
        min-height: 92px;
    }

    .choice-art {
        width: 74px;
        height: 68px;
    }

    .choice-action {
        display: none;
    }

    .custom-fields {
        grid-template-columns: 1fr auto 1fr;
    }

    .diagonal-field {
        grid-column: 1 / -1;
    }

    .result-row {
        display: block;
    }

    .area-chip {
        display: inline-block;
        margin-top: 10px;
    }

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

    .model-card {
        min-height: 116px;
        flex-direction: row;
    }

    .model-card-art {
        width: 118px;
        height: auto;
        min-height: 116px;
        flex: 0 0 118px;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
