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

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 520px;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-row input {
    flex: 1;
    min-width: 0;
}

input[type="url"],
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}

input[type="url"]:focus,
input[type="text"]:focus {
    border-color: #0071e3;
}

button {
    padding: 0.75rem 1rem;
    background: #0071e3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover {
    background: #0058b8;
}

button:disabled {
    background: #a1a1a6;
    cursor: not-allowed;
}

.row-btn {
    flex: 0 0 auto;
    width: 44px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 400;
}

.add-btn {
    background: #34c759;
}

.add-btn:hover {
    background: #2ba049;
}

.remove-btn {
    background: #ff3b30;
}

.remove-btn:hover {
    background: #c9281f;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: transparent;
    color: #6e6e73;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    width: auto;
}

.modal-close:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

#results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.result-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.result-row input {
    flex: 1;
    min-width: 0;
}

.copy-btn {
    flex: 0 0 auto;
    min-width: 90px;
}

.copy-btn.copied {
    background: #34c759;
}

.result-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    word-break: break-all;
}

.result-error strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
