:root {
    color-scheme: light;
    --bg: #f8fafc;
    --text: #17202a;
    --muted: #64748b;
    --line: #dce3ea;
    --panel: #ffffff;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --danger: #b42318;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-width: 320px;
}

img,
svg,
video {
    max-width: 100%;
}

a {
    color: var(--accent);
}

button,
input,
select,
textarea {
    font: inherit;
}

.intro {
    max-width: 720px;
    margin: 1rem 0 2rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 3.25rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.intro p:not(.eyebrow),
.tool-copy p:not(.eyebrow) {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.category-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
}

.category-card {
    min-height: 190px;
}

.tool-card {
    display: flex;
    min-height: 170px;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.tool-card:hover {
    border-color: #99b8b4;
}

.tool-card span {
    width: fit-content;
    padding: 0.25rem 0.45rem;
    color: #115e59;
    background: #d9f3ee;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
}

.tool-card strong {
    font-size: 1.2rem;
}

.tool-card small {
    color: var(--muted);
    line-height: 1.55;
}

.tool-page {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    margin-top: 1rem;
}

.tool-copy {
    padding-top: 1rem;
}

.tool-panel {
    position: relative;
    display: grid;
    gap: 0.85rem;
    min-width: 0;
    padding: 1.25rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.tool-panel label {
    color: #334155;
    font-weight: 700;
}

.field-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.field-heading small {
    color: var(--muted);
    line-height: 1.4;
    text-align: right;
}

.tool-panel input:not([type="file"]):not([type="range"]):not([type="checkbox"]),
.tool-panel select {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.75rem;
    color: var(--text);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.tool-panel textarea {
    width: 100%;
    min-height: 180px;
    padding: 0.8rem;
    color: var(--text);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    line-height: 1.55;
    resize: vertical;
}

.tool-panel textarea[readonly] {
    background: #f8fafc;
}

.tool-panel input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.inline-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.date-input-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-fields output {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    color: #334155;
    font-weight: 800;
}

.inline-fields label {
    display: grid;
    gap: 0.4rem;
}

.output-estimate {
    padding: 0.65rem 0.75rem;
    color: #115e59;
    background: #e8f6f3;
    border: 1px solid #b8ddd7;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.45;
}

.switch-row {
    grid-column: 1 / -1;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem !important;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-control {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 160ms ease;
}

.switch-control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 160ms ease;
}

.switch-row input:checked + .switch-control {
    background: var(--accent);
}

.switch-row input:checked + .switch-control::after {
    transform: translateX(18px);
}

.compact-switch {
    padding: 0;
    background: transparent;
    border: 0;
}

.manual-options {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.radio-group legend {
    width: 100%;
    margin-bottom: 0.15rem;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 800;
}

.radio-group label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem !important;
    min-height: 30px;
    padding: 0.25rem 0.5rem;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    font-size: 0.88rem;
    cursor: pointer;
}

.radio-group input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
}

.image-preview {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 320px;
    justify-self: center;
    object-fit: contain;
    background: #eef2f7;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.editable-preview {
    touch-action: none;
    cursor: crosshair;
}

.tool-hint {
    color: var(--muted);
    line-height: 1.45;
}

.square-preview {
    max-width: 260px;
    aspect-ratio: 1;
    justify-self: center;
}

.crop-shell {
    position: relative;
    width: fit-content;
    max-width: 100%;
    justify-self: center;
}

.crop-shell .image-preview {
    cursor: move;
}

.crop-box {
    position: absolute;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(15, 23, 42, 0.35);
    cursor: move;
    touch-action: none;
}

.crop-handle {
    position: absolute;
    right: -7px;
    bottom: -7px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: nwse-resize;
}

.drop-zone {
    display: grid;
    gap: 0.45rem;
    min-height: 150px;
    place-items: center;
    padding: 1.25rem;
    text-align: center;
    color: #334155;
    background: #f8fafc;
    border: 2px dashed #9bb5c9;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
    background: #eef8f6;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.drop-zone input[type="file"] {
    width: 1px;
    height: 1px;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    pointer-events: none;
}

.drop-zone span {
    font-weight: 800;
}

.drop-zone small {
    max-width: 100%;
    color: var(--muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.file-details {
    display: none;
    padding: 0.7rem 0.8rem;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #dbe4ee;
    border-radius: 6px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.file-details.is-visible {
    display: block;
}

.tool-panel button {
    min-height: 48px;
    margin-top: 0.25rem;
    color: #ffffff;
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.button-row button:last-child {
    color: #334155;
    background: #e7eef5;
}

.button-row button:last-child:hover {
    background: #dbe4ee;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
}

.option-grid label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #334155;
    font-weight: 700;
    line-height: 1.4;
}

.option-grid input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.text-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.text-stats div {
    display: grid;
    gap: 0.2rem;
    min-height: 78px;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
}

.text-stats span {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.text-stats small {
    color: var(--muted);
    font-weight: 700;
    line-height: 1.35;
}

.text-stats.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.converter-results {
    display: grid;
    gap: 0.65rem;
}

.converter-results div {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
}

.converter-results small {
    color: var(--muted);
    font-weight: 800;
}

.converter-results strong {
    color: #0f172a;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.date-results {
    gap: 0.5rem;
}

.date-results div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 46px;
    padding: 0.62rem 0.75rem;
    background: #f8fafc;
    border-color: #dbe4ee;
}

.date-results small {
    flex: 0 0 112px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.3;
}

.date-results span {
    flex: 1 1 auto;
    color: #17202a;
    font-size: 0.96rem;
    font-weight: 650;
    line-height: 1.45;
    text-align: right;
    overflow-wrap: anywhere;
}

.age-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.75rem;
    color: #17202a;
    background: #edf8f6;
    border: 1px solid #c8e5df;
    border-radius: 8px;
}

.age-result small {
    color: #115e59;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.3;
}

.age-result span {
    font-size: 0.96rem;
    font-weight: 650;
    line-height: 1.45;
    text-align: right;
    overflow-wrap: anywhere;
}

.video-results {
    display: grid;
    gap: 0.65rem;
}

.video-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
}

.video-result div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.video-result strong,
.video-result small {
    overflow-wrap: anywhere;
}

.video-result small {
    color: var(--muted);
}

.video-result a {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    color: #ffffff;
    background: var(--accent);
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
}

.video-result a:hover {
    background: var(--accent-strong);
}

.pdf-render-page p {
    margin: 0 0 0.65rem;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    unicode-bidi: plaintext;
}

.tool-panel button:hover {
    background: var(--accent-strong);
}

.preview-shell {
    position: relative;
    display: grid;
}

.icon-button {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: inline-grid;
    place-items: center;
    width: 38px !important;
    height: 38px;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.icon-button:hover {
    background: #ffffff !important;
}

.icon-button img {
    width: 24px;
    height: 24px;
    display: block;
}

.tool-panel button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.tool-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 26px;
    color: var(--muted);
    line-height: 1.5;
}

.tool-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(248, 250, 252, 0.66);
    border-radius: inherit;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.tool-panel::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 21;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border: 4px solid rgba(15, 118, 110, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.tool-panel.is-busy {
    cursor: wait;
}

.tool-panel.is-busy::before,
.tool-panel.is-busy::after {
    opacity: 1;
}

.tool-panel.is-busy > * {
    pointer-events: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.tool-status.is-error {
    color: var(--danger);
}

.ad-slot {
    display: grid;
    gap: 0.75rem;
    margin: 1.75rem 0 0;
}

.ad-slot-after-main {
    max-width: 1040px;
}

.ad-unit {
    min-width: 0;
}

.ad-unit-nativebanner {
    overflow: hidden;
    min-height: 90px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ad-smartlink {
    display: inline-flex;
    width: fit-content;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 0.8rem;
    color: #ffffff;
    background: var(--accent);
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.ad-smartlink:hover {
    background: var(--accent-strong);
}

.ad-sandbox-frame {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    width: min(430px, calc(100vw - 32px));
    height: 128px;
    border: 0;
    background: transparent;
    pointer-events: auto;
}

@media (max-width: 560px) {
    .ad-sandbox-frame {
        bottom: 10px;
        right: 10px;
        width: calc(100vw - 20px);
        height: 132px;
    }
}

.seo-content {
    display: grid;
    gap: 1.6rem;
    margin-top: 3rem;
    padding-top: 2rem;
    color: #243244;
    border-top: 1px solid var(--line);
}

.seo-content-header {
    max-width: 920px;
}

.seo-content h2,
.seo-content h3,
.seo-content p {
    margin: 0;
}

.seo-content h2 {
    color: var(--text);
    font-size: 1.65rem;
    line-height: 1.25;
}

.seo-content h3 {
    color: #203047;
    font-size: 1.05rem;
    line-height: 1.35;
}

.seo-content p,
.seo-content li,
.comparison-table span,
.seo-related-grid span {
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.75;
}

.seo-content-header > p:not(.eyebrow),
.seo-section > p {
    margin-top: 0.7rem;
}

.seo-section {
    display: grid;
    gap: 0.9rem;
    max-width: 1040px;
}

.seo-list-grid,
.seo-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.85rem;
}

.seo-list-grid article,
.seo-related-grid a,
.faq-list details {
    min-width: 0;
    padding: 0.95rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.seo-list-grid strong,
.seo-related-grid strong,
.comparison-table strong,
.seo-steps strong {
    display: block;
    color: #17202a;
    font-size: 0.95rem;
    line-height: 1.4;
}

.seo-list-grid p {
    margin-top: 0.35rem;
}

.seo-check-list,
.seo-steps {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding-left: 1.15rem;
}

.seo-check-list li,
.seo-steps li {
    padding-left: 0.15rem;
}

.seo-steps li span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.comparison-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.comparison-table div {
    display: grid;
    grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    background: rgba(255, 255, 255, 0.62);
}

.comparison-table div + div {
    border-top: 1px solid var(--line);
}

.seo-related-grid a {
    color: inherit;
    text-decoration: none;
}

.seo-related-grid a:hover {
    border-color: #99b8b4;
}

.faq-list {
    display: grid;
    gap: 0.65rem;
}

.faq-list summary {
    cursor: pointer;
    color: #17202a;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.45;
}

.faq-list p {
    margin-top: 0.55rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 900px) {
    .tool-page {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .tool-copy {
        padding-top: 0;
    }
}

@media (max-width: 560px) {
    .intro {
        margin: 0.25rem 0 1.25rem;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .tool-card,
    .category-card {
        min-height: auto;
        padding: 0.9rem;
    }

    .tool-page {
        margin-top: 0;
    }

    .tool-panel {
        gap: 0.75rem;
        padding: 0.9rem;
    }

    .inline-fields {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .date-input-row {
        grid-template-columns: 1fr;
    }

    .button-row,
    .option-grid,
    .text-stats,
    .text-stats.compact {
        grid-template-columns: 1fr;
    }

    .date-results div,
    .age-result {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }

    .date-results small {
        flex-basis: auto;
    }

    .date-results span,
    .age-result span {
        text-align: left;
    }

    .video-result {
        align-items: stretch;
        flex-direction: column;
    }

    .drop-zone {
        min-height: 128px;
        padding: 1rem;
    }

    .field-heading {
        display: grid;
        gap: 0.25rem;
    }

    .field-heading small {
        text-align: left;
    }

    h1 {
        font-size: 2.15rem;
        line-height: 1.12;
    }

    .intro p:not(.eyebrow),
    .tool-copy p:not(.eyebrow) {
        font-size: 1rem;
        line-height: 1.6;
    }

    .seo-content {
        margin-top: 2rem;
        padding-top: 1.4rem;
    }

    .seo-content h2 {
        font-size: 1.35rem;
    }

    .seo-list-grid,
    .seo-related-grid,
    .comparison-table div {
        grid-template-columns: 1fr;
    }

    .comparison-table div {
        gap: 0.3rem;
    }
}

@media (min-width: 561px) and (max-width: 900px) {
    h1 {
        font-size: 2.65rem;
    }
}
