:root {
    --bg: #ffffff;
    --fg: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --border: #d1d5db;
    --radius: 6px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px 12px;
    background: #fff;
    color: var(--fg);
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-wrap: break-word;
}

main {
    width: 100%;
    max-width: 700px;
}

header {
    text-align: center;
    margin-bottom: 20px
}

header h1 {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 600
}

header p {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px
}

form {
    display: grid;
    gap: 14px
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px
}

input[type="text"],
input[readonly] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--fg);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--fg);
}

.btn:focus-visible,
input:focus-visible,
footer a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none
}

#outputSection {
    margin-top: 20px;
    display: none
}

#output {
    word-break: break-all;
}

.output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px
}

.small {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px
}

footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--muted)
}

footer a {
    color: var(--accent);
    text-decoration: none
}

.comments {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: left;
    overflow: hidden;
}

.comments h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.giscus,
.giscus-frame {
    max-width: 100%;
}

@media(max-width:600px) {
    body {
        align-items: flex-start;
        padding: 12px;
    }

    header h1 {
        font-size: 18px
    }

    header p {
        font-size: 13px;
        line-height: 1.5;
    }

    main {
        max-width: none;
    }

    form {
        gap: 12px;
    }

    .controls,
    .output-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center
    }

    #generated-link-heading {
        line-height: 1.4;
    }
}

@media(max-width:380px) {
    body {
        padding: 10px;
    }

    header {
        margin-bottom: 16px;
    }

    header h1 {
        font-size: 17px;
    }

    input[type="text"],
    input[readonly],
    .btn {
        font-size: 13px;
    }

    .small,
    footer {
        font-size: 12px;
        line-height: 1.5;
    }
}

@media(max-height:500px) and (orientation:landscape) {
    body {
        align-items: flex-start;
    }

    header {
        margin-bottom: 14px;
    }
}
