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


:root {
    --site-shell-max-width: 1100px;
    --site-page-gutter: clamp(12px, 2.4vw, 22px);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f766e 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--site-page-gutter);
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 36px;
    max-width: var(--site-shell-max-width);
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #475569;
    margin-bottom: 26px;
    font-size: 16px;
    line-height: 1.6;
}

.privacy-notice {
    background: linear-gradient(135deg, #ccfbf1 0%, #ecfeff 100%);
    border: 2px solid #0f766e;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15);
}

.privacy-icon {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f766e;
    background: rgba(15, 118, 110, 0.12);
    border-radius: 999px;
    padding: 6px 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.privacy-content strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.privacy-content p {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.6;
}

.tool-section {
    border: 2px solid #dbe4ef;
    border-radius: 14px;
    background: #ffffff;
    padding: 16px;
    margin-bottom: 16px;
}

.tool-section h2 {
    font-size: 19px;
    color: #0f766e;
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

input[type="text"],
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 44px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    resize: vertical;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}

textarea[readonly] {
    background: #f8fafc;
}

.flags-fieldset {
    border: 1px solid #d1dbe8;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 12px 0;
}

.flags-fieldset legend {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    padding: 0 6px;
}

.flag-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 14px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}

.flag-option input {
    width: 16px;
    height: 16px;
}

.output-preview {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    color: #1e293b;
    min-height: 52px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.output-preview mark {
    background: #fef08a;
    color: #1f2937;
    border-radius: 4px;
    padding: 1px 2px;
}

.output-preview mark.zero-length {
    background: #fed7aa;
}

.hint {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.auto-run-hint {
    margin-top: 8px;
    margin-bottom: 10px;
    color: #0f766e;
    font-weight: 600;
}

.replacement-hint {
    margin-top: 8px;
    margin-bottom: 10px;
}

.replacement-hint code {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    background: #e2e8f0;
    color: #334155;
    border-radius: 4px;
    padding: 1px 6px;
    margin: 0 1px;
}

.pattern-explanation-list {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    min-height: 52px;
    max-height: 280px;
    overflow: auto;
    margin: 0 0 12px;
    padding: 8px 10px;
    list-style: none;
}

.pattern-explanation-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 6px 4px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #1e293b;
}

.pattern-explanation-item:last-child {
    border-bottom: none;
}

.pattern-explanation-token {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #0f766e;
    background: #ecfeff;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    padding: 2px 6px;
    white-space: nowrap;
}

.pattern-explanation-warning {
    border-top: 1px dashed #f59e0b;
    margin-top: 6px;
    padding: 8px 4px 4px;
    font-size: 13px;
    color: #92400e;
    font-weight: 600;
}

.pattern-explanation-empty {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 4px;
}

.snippet-box {
    border: 1px solid #d1dbe8;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
    margin-top: 12px;
}

.snippet-box h3 {
    font-size: 16px;
    color: #0f766e;
    margin-bottom: 10px;
}

.quick-reference-panel {
    border: 1px solid #d1dbe8;
    border-radius: 12px;
    background: #f8fafc;
}

.quick-reference-panel summary {
    cursor: pointer;
    list-style: none;
    font-size: 18px;
    font-weight: 700;
    color: #0f766e;
    padding: 12px 14px;
    border-bottom: 1px solid #dbe4ef;
}

.quick-reference-panel summary::-webkit-details-marker {
    display: none;
}

.quick-reference-content {
    padding: 12px 14px 14px;
}

.quick-reference-layout {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 12px;
}

.quick-reference-categories {
    border: 1px solid #d1dbe8;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
    max-height: 340px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-reference-category {
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}

.quick-reference-category:hover {
    border-color: #0f766e;
}

.quick-reference-category.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.quick-reference-results {
    border: 1px solid #d1dbe8;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
}

.quick-reference-status {
    margin-bottom: 8px;
}

.quick-reference-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 340px;
    overflow: auto;
}

.quick-reference-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.quick-reference-row:last-child {
    border-bottom: none;
}

.quick-reference-description {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.4;
}

.quick-reference-token {
    border: 1px solid #0f766e;
    border-radius: 8px;
    background: #ecfeff;
    color: #0f766e;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 8px;
    min-width: 64px;
    text-align: center;
    cursor: pointer;
}

.quick-reference-token:hover {
    background: #ccfbf1;
}

.quick-reference-token.static-token {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

.quick-reference-empty {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 8px;
}

.actions {
    margin-top: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.centered-actions {
    justify-content: center;
}

.action-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    min-height: 42px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #0f766e 0%, #0f4c81 100%);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.42);
}

.secondary-btn {
    background: linear-gradient(135deg, #475569 0%, #1f2937 100%);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.27);
}

.secondary-btn:hover {
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.36);
}

.status {
    margin-top: 8px;
    min-height: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.footer-links {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 2px solid #e2e8f0;
    text-align: center;
}

.footer-links a {
    color: #0f766e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 0 10px;
    transition: color 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #155e75;
    text-decoration: underline;
}

.back-btn {
    display: inline-block;
    padding: 10px 18px;
    margin-right: 6px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0f766e 0%, #0f4c81 100%);
    color: #fff !important;
    border-radius: 10px;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.4);
}

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

@media (max-width: 900px) {
    .container {
        padding: 26px 18px;
    }
}

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

    h1 {
        font-size: 27px;
    }

    .subtitle {
        font-size: 15px;
    }

    .actions {
        justify-content: stretch;
    }

    .action-btn {
        flex: 1 1 150px;
        min-height: 44px;
    }

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

    .quick-reference-categories {
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .quick-reference-category {
        text-align: center;
    }
}

