/* ============================================
   Spatial-Sandbox Components — components.css
   ============================================ */

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
    height: 36px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color var(--t-base), color var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
    white-space: nowrap;
    text-decoration: none;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Primary */
.btn-primary {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Secondary / Ghost */
.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-secondary:hover {
    background-color: var(--bg-alt);
    color: var(--text);
    border-color: var(--border-strong);
}

/* Danger */
.btn-danger {
    background-color: transparent;
    color: var(--danger);
    border-color: transparent;
}
.btn-danger:hover {
    background-color: var(--danger-bg);
    border-color: var(--danger);
}

/* Ghost icon-only */
.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color var(--t-base), color var(--t-base);
    flex-shrink: 0;
}
.btn-icon:hover {
    background-color: var(--bg-alt);
    color: var(--text);
}

/* ==========================================
   GEOMETRY CARDS
   ========================================== */

.geometry-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-top: var(--sp-2);
    flex: 1;
    overflow-y: auto;
    padding-right: var(--sp-2); /* prevent scrollbar from hiding content */
}

/* Scrollbar styling for geometry list */
.geometry-list::-webkit-scrollbar {
    width: 6px;
}
.geometry-list::-webkit-scrollbar-track {
    background: transparent;
}
.geometry-list::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}
.geometry-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-subtle);
}

.geometry-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--t-base), box-shadow var(--t-base);
    flex-shrink: 0; /* Prevent smushing in scrollable list */
}

.geometry-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}

.geometry-card-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    min-height: 40px;
}

.geom-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.geom-name-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    min-width: 0;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: background-color var(--t-base);
    text-align: left;
}

.geom-name-input:hover {
    background-color: var(--bg-alt);
}

.geom-name-input:focus {
    background-color: var(--bg-alt);
    outline: 1px solid var(--accent);
}

.geometry-card-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-3) var(--sp-2);
}

.geom-type-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px var(--sp-2);
    border-radius: var(--radius-full);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.geom-info-text {
    font-size: 0.7rem;
    color: var(--text-subtle);
}

.geometry-card-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-3);
    border-top: 1px solid var(--border);
    background-color: var(--bg-alt);
}

/* Copy group stays left, icon buttons group stays right */
.geometry-card-actions .actions-right {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

/* Color picker swatch */
.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}

.color-swatch input[type="color"] {
    width: 200%;
    height: 200%;
    margin: -25%;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    position: absolute;
}

.color-swatch-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Copy format select */
.copy-format-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 26px;
}

.copy-format-select {
    border: none;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: var(--font-sans);
    padding: 0 var(--sp-1) 0 var(--sp-2);
    cursor: pointer;
    outline: none;
    height: 100%;
}

.copy-format-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-light);
}

.copy-format-btn {
    border: none;
    border-left: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--font-sans);
    padding: 0 var(--sp-2);
    cursor: pointer;
    height: 100%;
    transition: background-color var(--t-base), color var(--t-base);
}

.copy-format-btn:hover {
    background-color: var(--bg-alt);
    color: var(--text);
}

/* ==========================================
   MODALS
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--sp-4);
    animation: fadeIn var(--t-slow) ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-box {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--t-slow) ease;
    overflow: hidden;
}

.modal-box.modal-wide {
    max-width: 680px;
}

.modal-box.modal-confirm {
    max-width: 400px;
}

.modal-confirm .modal-body p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-head h2 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background-color var(--t-base), color var(--t-base);
}

.modal-close:hover {
    background-color: var(--bg-alt);
    color: var(--text);
}

.modal-body {
    padding: var(--sp-5) var(--sp-6);
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.modal-foot {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background-color: var(--bg-alt);
}

/* All buttons inside a modal footer are auto-width */
.modal-foot .btn {
    width: auto;
    min-width: 80px;
    flex-shrink: 0;
}

/*
 * When multiple buttons exist, push the FIRST one to the left
 * (e.g. Validate | ... | Cancel  Add to Map)
 * Single-button modals: button stays on the right via justify-content below.
 */
.modal-foot > .btn:first-child:not(:last-child) {
    margin-right: auto;
}

/* Single-button or final-button alignment — push lone buttons to the right */
.modal-foot > .btn:only-child {
    margin-left: auto;
}

.sidebar-footer .section-label {
    margin-bottom: 0;
}

.sidebar-footer-actions {
    display: flex;
    flex-direction: row;
    gap: var(--sp-2);
    width: 100%;
}

/* CRS Label + Info Button Row */
.crs-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crs-info-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: background-color var(--t-base), color var(--t-base), border-color var(--t-base);
    flex-shrink: 0;
}

.info-btn:hover,
.info-btn.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Tooltip popover — opens upward */
.crs-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 230px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--sp-3);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.crs-tooltip code {
    font-family: var(--font-mono);
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 3px;
    font-size: 0.7rem;
    color: var(--accent);
}

/* Tooltip arrow */
.crs-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
}

/* Show on hover (desktop) or .open class (JS toggle) */
.crs-info-wrap:hover .crs-tooltip,
.crs-info-wrap .crs-tooltip.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ==========================================
   ADD GEOMETRY MODAL SPECIFICS
   ========================================== */

.input-type-tabs {
    display: flex;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.type-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-sans);
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--t-base), color var(--t-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
}

.type-tab.active {
    background-color: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

.type-tab:hover:not(.active) {
    color: var(--text);
}

.geom-textarea {
    width: 100%;
    min-height: 160px;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--t-base), background-color var(--t-base);
}

.geom-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--surface);
}

.geom-textarea::placeholder {
    color: var(--text-subtle);
    font-family: var(--font-sans);
}

/* Drop zone highlight */
.drop-active {
    border-color: var(--accent) !important;
    background-color: var(--accent-light) !important;
}

/* ==========================================
   VALIDATION MESSAGE
   ========================================== */

.validation-msg {
    display: none;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

.validation-msg.success {
    display: block;
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid currentColor;
}

.validation-msg.error {
    display: block;
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid currentColor;
}

/* ==========================================
   CRS INPUT
   ========================================== */

.crs-row {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    margin-top: var(--sp-2);
}

.crs-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: var(--sp-1) var(--sp-3);
    height: 32px;
    transition: border-color var(--t-base);
}

.crs-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    z-index: 4000;
    pointer-events: none;
}

.toast {
    background-color: var(--surface);
    color: var(--text);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity var(--t-slow), transform var(--t-slow);
    pointer-events: auto;
    max-width: 320px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-info {
    border-left-color: var(--accent);
}

/* ==========================================
   ABOUT / FAQ / INFO MODALS
   ========================================== */

.about-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.about-logo-mark {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.5rem;
}

.about-logo-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.about-logo-text p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.about-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-2);
}

.tech-chip {
    font-size: 0.75rem;
    font-weight: 500;
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--radius-full);
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* FAQ Accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item summary {
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    transition: background-color var(--t-base);
    background-color: var(--surface);
}

.faq-item summary:hover {
    background-color: var(--bg-alt);
}

.faq-item summary::after {
    content: '+';
    font-size: 1.1rem;
    color: var(--text-subtle);
    flex-shrink: 0;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item[open] summary {
    background-color: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.faq-answer {
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.7;
    background-color: var(--surface);
}

/* Contact Form */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
}

.form-input {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: var(--sp-2) var(--sp-3);
    height: 38px;
    transition: border-color var(--t-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--surface);
}

.form-textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-alt);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: var(--sp-2) var(--sp-3);
    min-height: 100px;
    resize: vertical;
    transition: border-color var(--t-base);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--surface);
}

/* Privacy / Terms */
.prose {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.prose h3 {
    font-size: 0.875rem;
    color: var(--text);
    margin-top: var(--sp-4);
    margin-bottom: var(--sp-2);
}

.prose h3:first-child {
    margin-top: 0;
}

.prose p {
    margin-bottom: var(--sp-3);
}

.prose ul {
    list-style: disc;
    padding-left: var(--sp-5);
}

.prose li {
    margin-bottom: var(--sp-1);
}

/* ==========================================
   SIDEBAR SECTION TITLES
   ========================================== */

.add-geom-btn-row {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

/* Map Leaflet Customization */
.leaflet-bar a,
.leaflet-bar a:hover {
    text-decoration: none !important;
}

.leaflet-bar {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden;
}

.leaflet-bar a {
    border-bottom-color: var(--border) !important;
    background-color: var(--surface) !important;
    color: var(--text) !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.leaflet-bar a:hover {
    background-color: var(--bg-alt) !important;
    color: var(--text) !important;
}

.leaflet-control-layers {
    background-color: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    font-family: var(--font-sans) !important;
    font-size: 0.8125rem !important;
    color: var(--text) !important;
    padding: var(--sp-2) var(--sp-3) !important;
}

.leaflet-control-layers-toggle {
    background-color: var(--surface) !important;
    width: 26px !important;
    height: 26px !important;
    background-size: 18px 18px !important;
    background-position: center !important;
}

.map-coords {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-1) var(--sp-3);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    margin-bottom: 6px !important;
    margin-left: 8px !important;
    -webkit-user-select: none;
    user-select: none;
}

.leaflet-bottom {
    z-index: 900 !important;
    margin-bottom: 2px !important;
}

.leaflet-control-attribution {
    font-size: 0.65rem !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-muted) !important;
    padding: 2px 8px !important;
    border-radius: var(--radius-sm);
    margin-bottom: 6px !important;
    margin-right: 8px !important;
    line-height: 1.4 !important;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}

.theme-dark .leaflet-control-attribution {
    background: rgba(24, 24, 27, 0.9) !important;
    color: var(--text-subtle) !important;
    border-color: var(--border);
}

.theme-dark .leaflet-control-attribution a {
    color: var(--accent) !important;
}

/* ==========================================
   DRAWING TOOLS
   ========================================== */

/* The drawing toolbar */
.draw-toolbar {
    display: flex;
    flex-direction: column;
}

.draw-tool-btn {
    font-size: 1.1rem !important;
}

.draw-tool-btn.active {
    background-color: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}

/* Actions panel floating on map */
.draw-actions-panel {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-2);
    display: flex;
    gap: var(--sp-2);
    margin-bottom: 20px; /* offset from bottom */
}

/* Tooltip attached to cursor */
.draw-tooltip {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--sp-1) var(--sp-2);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

/* Change cursor to crosshair on the map when drawing */
.drawing-mode .leaflet-container {
    cursor: crosshair !important;
}

/* ==========================================
   DOCUMENTATION & EXAMPLES SECTION (Below Map)
   ========================================== */

.doc-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px var(--sp-6) 10px;
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
}

.doc-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.doc-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: var(--sp-3);
    line-height: 1.25;
}

.doc-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--sp-6);
}

.doc-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.doc-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.doc-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.doc-card-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.geom-types-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--sp-2);
    margin-top: var(--sp-2);
}

.geom-type-chip {
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-2) var(--sp-3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.doc-code-block {
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
}

.doc-code-block code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text);
    overflow-x: auto;
    white-space: nowrap;
}

.doc-code-btn {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-base);
}

.doc-code-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-light);
}

.quick-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-4);
}

.quick-tool-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-5);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    text-decoration: none;
    transition: all var(--t-base);
}

.quick-tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.quick-tool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
}

.quick-tool-card:hover h3 {
    color: var(--accent);
}

.quick-tool-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}
