*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f1f3f5;
    color: #212529;
    line-height: 1.5;
}
.wrap {
    width: 85%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px;
}
@media (max-width: 600px) {
    .wrap { width: 100%; padding: 10px; }
}
header.hdr {
    background: linear-gradient(135deg, #00838f 0%, #006064 100%);
    color: #fff;
    padding: 18px 22px;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
header.hdr h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.id-section {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.id-section label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: #495057;
}
.id-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.id-row input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 1.05rem;
    font-family: monospace;
    border: 2px solid #ced4da;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.1s;
}
.id-row input:focus {
    border-color: #00838f;
}
.id-row button {
    flex: 0 0 auto;
    padding: 10px 18px;
    background: #00838f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
}
.id-row button:active { background: #006064; }
.id-row button:disabled { opacity: 0.6; cursor: progress; }

.section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6c757d;
    margin: 14px 2px 6px 2px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.link-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 720px) {
    .link-grid { grid-template-columns: repeat(2, 1fr); }
}

.link-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
    border-left: 4px solid #0d6efd;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.link-card.is-general  { border-left-color: #00838f; }
.link-card.is-tools    { border-left-color: #6f42c1; }
.link-card.is-disabled { opacity: 0.55; border-left-color: #adb5bd; }
.link-card.is-error    { border-left-color: #dc3545; }
.link-purpose {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    line-height: 1.35;
}
.link-description {
    font-weight: 400;
    color: #6c757d;
}
.link-url {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    color: #495057;
    word-break: break-all;
    background: #f8f9fa;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}
.link-url.placeholder {
    color: #adb5bd;
    font-style: italic;
    font-family: inherit;
    font-size: 0.85rem;
}
.link-url.error-text {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
    font-family: inherit;
    font-size: 0.85rem;
}
.link-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}
.btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.1s;
}
.btn-primary {
    background: #0d6efd;
    color: #fff !important;
    border-color: #0d6efd;
}
.btn-primary:active { background: #0a58ca; }
.btn-secondary {
    background: #e9ecef;
    color: #212529 !important;
    border-color: #ced4da;
}
.btn-secondary:active { background: #ced4da; }
.btn.copied {
    background: #20c997 !important;
    color: #fff !important;
    border-color: #20c997 !important;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: #212529;
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.18s, transform 0.18s;
    z-index: 100;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.loader-row {
    text-align: center;
    padding: 16px;
    color: #6c757d;
    font-size: 0.92rem;
}
.error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 0.92rem;
}
